From ec99a5982d8953aaf12b2f7017fe74d6478f3ccc Mon Sep 17 00:00:00 2001 From: Robert Scholte Date: Thu, 11 Aug 2016 22:13:46 +0000 Subject: [PATCH] Integration tests now reuse source/target values project, otherwise some tests use 1.5 as default which would make them fail when using JDK9 git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1756058 13f79535-47bb-0310-9956-ffa450edef68 --- maven-plugin-plugin/pom.xml | 4 + .../maven/plugins/issues/plugin/MyMojo.java | 84 ------------------- .../main/resources/META-INF/maven/plugin.xml | 69 +++++++++++++++ .../maven/plugins/issues/plugin/MyMojo.java | 84 ------------------- .../main/resources/META-INF/maven/plugin.xml | 69 +++++++++++++++ .../src/it/plugin-info-jdk/pom.xml | 3 + .../maven/plugins/issues/plugin/MyMojo.java | 84 ------------------- .../main/resources/META-INF/maven/plugin.xml | 69 +++++++++++++++ .../maven/plugins/issues/plugin/MyMojo.java | 84 ------------------- .../main/resources/META-INF/maven/plugin.xml | 69 +++++++++++++++ .../src/it/plugin-info-jdk/test.properties | 18 ++++ .../src/it/plugin-report/pom.xml | 10 +++ 12 files changed, 311 insertions(+), 336 deletions(-) delete mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java create mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/resources/META-INF/maven/plugin.xml delete mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java create mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/resources/META-INF/maven/plugin.xml delete mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java create mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/resources/META-INF/maven/plugin.xml delete mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java create mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/resources/META-INF/maven/plugin.xml create mode 100644 maven-plugin-plugin/src/it/plugin-info-jdk/test.properties diff --git a/maven-plugin-plugin/pom.xml b/maven-plugin-plugin/pom.xml index b433833..0fcb82a 100644 --- a/maven-plugin-plugin/pom.xml +++ b/maven-plugin-plugin/pom.xml @@ -370,6 +370,10 @@ 3.3 ${antVersion} + + ${maven.compiler.source} + ${maven.compiler.target} + diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java b/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java deleted file mode 100644 index ec3f1db..0000000 --- a/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.apache.maven.plugins.issues.plugin; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * Goal which touches a timestamp file. - * - * @goal touch - * - * @phase process-sources - */ -public class MyMojo - extends AbstractMojo -{ - /** - * Location of the file. - * @parameter expression="${project.build.directory}" - * @required - */ - private File outputDirectory; - - public void execute() - throws MojoExecutionException - { - File f = outputDirectory; - - if ( !f.exists() ) - { - f.mkdirs(); - } - - File touch = new File( f, "touch.txt" ); - - FileWriter w = null; - try - { - w = new FileWriter( touch ); - - w.write( "touch.txt" ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error creating file " + touch, e ); - } - finally - { - if ( w != null ) - { - try - { - w.close(); - } - catch ( IOException e ) - { - // ignore - } - } - } - } -} diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/resources/META-INF/maven/plugin.xml b/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/resources/META-INF/maven/plugin.xml new file mode 100644 index 0000000..d8fd440 --- /dev/null +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/plugin/src/main/resources/META-INF/maven/plugin.xml @@ -0,0 +1,69 @@ + + + + + + target bytecode defined by plugin configuration + + org.apache.maven.its.plugin-info-jdk + plugin + 1.0-SNAPSHOT + + false + true + + + touch + Goal which touches a timestamp file. + false + true + false + false + false + true + process-sources + org.apache.maven.plugins.issues.plugin.MyMojo + java + per-lookup + once-per-session + false + + + outputDirectory + java.io.File + true + true + Location of the file. + + + + ${project.build.directory} + + + + + + org.apache.maven + maven-plugin-api + jar + 2.0 + + + \ No newline at end of file diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java b/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java deleted file mode 100644 index ec3f1db..0000000 --- a/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.apache.maven.plugins.issues.plugin; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * Goal which touches a timestamp file. - * - * @goal touch - * - * @phase process-sources - */ -public class MyMojo - extends AbstractMojo -{ - /** - * Location of the file. - * @parameter expression="${project.build.directory}" - * @required - */ - private File outputDirectory; - - public void execute() - throws MojoExecutionException - { - File f = outputDirectory; - - if ( !f.exists() ) - { - f.mkdirs(); - } - - File touch = new File( f, "touch.txt" ); - - FileWriter w = null; - try - { - w = new FileWriter( touch ); - - w.write( "touch.txt" ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error creating file " + touch, e ); - } - finally - { - if ( w != null ) - { - try - { - w.close(); - } - catch ( IOException e ) - { - // ignore - } - } - } - } -} diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/resources/META-INF/maven/plugin.xml b/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/resources/META-INF/maven/plugin.xml new file mode 100644 index 0000000..1ca3b06 --- /dev/null +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/pluginManagement/src/main/resources/META-INF/maven/plugin.xml @@ -0,0 +1,69 @@ + + + + + + target bytecode defined by pluginManagement configuration + + org.apache.maven.its.plugin-info-jdk + pluginManagement + 1.0-SNAPSHOT + Management + false + true + + + touch + Goal which touches a timestamp file. + false + true + false + false + false + true + process-sources + org.apache.maven.plugins.issues.plugin.MyMojo + java + per-lookup + once-per-session + false + + + outputDirectory + java.io.File + true + true + Location of the file. + + + + ${project.build.directory} + + + + + + org.apache.maven + maven-plugin-api + jar + 2.0 + + + \ No newline at end of file diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/pom.xml b/maven-plugin-plugin/src/it/plugin-info-jdk/pom.xml index b603114..a184f45 100644 --- a/maven-plugin-plugin/src/it/plugin-info-jdk/pom.xml +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/pom.xml @@ -59,6 +59,9 @@ under the License. org.apache.maven.plugins maven-plugin-plugin @project.version@ + + true + org.apache.maven.plugins diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java b/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java deleted file mode 100644 index ec3f1db..0000000 --- a/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.apache.maven.plugins.issues.plugin; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * Goal which touches a timestamp file. - * - * @goal touch - * - * @phase process-sources - */ -public class MyMojo - extends AbstractMojo -{ - /** - * Location of the file. - * @parameter expression="${project.build.directory}" - * @required - */ - private File outputDirectory; - - public void execute() - throws MojoExecutionException - { - File f = outputDirectory; - - if ( !f.exists() ) - { - f.mkdirs(); - } - - File touch = new File( f, "touch.txt" ); - - FileWriter w = null; - try - { - w = new FileWriter( touch ); - - w.write( "touch.txt" ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error creating file " + touch, e ); - } - finally - { - if ( w != null ) - { - try - { - w.close(); - } - catch ( IOException e ) - { - // ignore - } - } - } - } -} diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/resources/META-INF/maven/plugin.xml b/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/resources/META-INF/maven/plugin.xml new file mode 100644 index 0000000..bb4aaa6 --- /dev/null +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/property/src/main/resources/META-INF/maven/plugin.xml @@ -0,0 +1,69 @@ + + + + + + target bytecode defined by maven.compiler.target property + + org.apache.maven.its.plugin-info-jdk + property + 1.0-SNAPSHOT + property + false + true + + + touch + Goal which touches a timestamp file. + false + true + false + false + false + true + process-sources + org.apache.maven.plugins.issues.plugin.MyMojo + java + per-lookup + once-per-session + false + + + outputDirectory + java.io.File + true + true + Location of the file. + + + + ${project.build.directory} + + + + + + org.apache.maven + maven-plugin-api + jar + 2.0 + + + \ No newline at end of file diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java b/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java deleted file mode 100644 index ec3f1db..0000000 --- a/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/java/org/apache/maven/plugins/issues/plugin/MyMojo.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.apache.maven.plugins.issues.plugin; - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * Goal which touches a timestamp file. - * - * @goal touch - * - * @phase process-sources - */ -public class MyMojo - extends AbstractMojo -{ - /** - * Location of the file. - * @parameter expression="${project.build.directory}" - * @required - */ - private File outputDirectory; - - public void execute() - throws MojoExecutionException - { - File f = outputDirectory; - - if ( !f.exists() ) - { - f.mkdirs(); - } - - File touch = new File( f, "touch.txt" ); - - FileWriter w = null; - try - { - w = new FileWriter( touch ); - - w.write( "touch.txt" ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( "Error creating file " + touch, e ); - } - finally - { - if ( w != null ) - { - try - { - w.close(); - } - catch ( IOException e ) - { - // ignore - } - } - } - } -} diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/resources/META-INF/maven/plugin.xml b/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/resources/META-INF/maven/plugin.xml new file mode 100644 index 0000000..91a517a --- /dev/null +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/requirement/src/main/resources/META-INF/maven/plugin.xml @@ -0,0 +1,69 @@ + + + + + + target bytecode defined by report jdk requirement configuration + + org.apache.maven.its.plugin-info-jdk + requirement + 1.0-SNAPSHOT + requirement + false + true + + + touch + Goal which touches a timestamp file. + false + true + false + false + false + true + process-sources + org.apache.maven.plugins.issues.plugin.MyMojo + java + per-lookup + once-per-session + false + + + outputDirectory + java.io.File + true + true + Location of the file. + + + + ${project.build.directory} + + + + + + org.apache.maven + maven-plugin-api + jar + 2.0 + + + \ No newline at end of file diff --git a/maven-plugin-plugin/src/it/plugin-info-jdk/test.properties b/maven-plugin-plugin/src/it/plugin-info-jdk/test.properties new file mode 100644 index 0000000..ba4a6b0 --- /dev/null +++ b/maven-plugin-plugin/src/it/plugin-info-jdk/test.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +maven.compiler.source=1.3 +maven.compiler.target=1.3 \ No newline at end of file diff --git a/maven-plugin-plugin/src/it/plugin-report/pom.xml b/maven-plugin-plugin/src/it/plugin-report/pom.xml index 9526d2d..cf7ac80 100644 --- a/maven-plugin-plugin/src/it/plugin-report/pom.xml +++ b/maven-plugin-plugin/src/it/plugin-report/pom.xml @@ -62,6 +62,16 @@ under the License. + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + + ${maven.compiler.source} + ${maven.compiler.target} + + org.apache.maven.plugins maven-plugin-plugin