This is an automated email from the ASF dual-hosted git repository.
slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git
The following commit(s) were added to refs/heads/master by this push:
new d5ee65d5 Combine and fix maven-plugin-plugin ITs
d5ee65d5 is described below
commit d5ee65d53df41a161716cb8244a32f075b6c9c43
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Wed Nov 4 20:19:05 2026 +0000
Combine and fix maven-plugin-plugin ITs
mplugin-299 now reads help.log, the three mplugin-305 and the two help-basic
ITs become one each, and the stale plugin-info-jdk pomExclude is removed:
that IT lives in maven-plugin-report-plugin and still runs.
Fixes #1262
---
maven-plugin-plugin/pom.xml | 6 +-
.../invoker.properties | 19 --
.../test.properties | 19 --
.../expected-help.txt | 0
.../help-deprecated-annotation-only}/pom.xml | 0
.../src/main/java/test/MyMojo.java | 0
.../src/it/help-basic/{ => help}/expected-help.txt | 0
.../src/it/help-basic/{ => help}/pom.xml | 0
.../{ => help}/src/main/java/test/MyMojo.java | 0
.../src/it/help-basic/invoker.properties | 3 +-
maven-plugin-plugin/src/it/help-basic/pom.xml | 63 +-----
.../src/it/help-basic/verify.groovy | 16 +-
.../verify.groovy | 11 +-
.../it/mplugin-305_defaultMojoDependencies/pom.xml | 84 --------
.../invoker.properties | 18 --
.../plugins/plugin/it/CustomSurefireMojo.java | 213 ---------------------
.../verify.groovy | 28 ---
.../invoker.properties | 5 +-
.../pom.xml | 55 +++++-
.../plugins/plugin/it/CustomSurefireMojo.java | 0
.../plugins/plugin/it/CustomSurefireMojo.java | 0
.../verify.groovy | 21 +-
.../invoker.properties | 18 --
.../it/mplugin-305_singleMojoDependencies/pom.xml | 87 ---------
.../verify.groovy | 28 ---
25 files changed, 95 insertions(+), 599 deletions(-)
diff --git a/maven-plugin-plugin/pom.xml b/maven-plugin-plugin/pom.xml
index 8213bb35..ba25e83a 100644
--- a/maven-plugin-plugin/pom.xml
+++ b/maven-plugin-plugin/pom.xml
@@ -167,7 +167,7 @@
<configuration>
<inputExcludes combine.children="append">
<!-- This file should exactly match the output of this project
-->
- <exclude>src/it/help-basic**/expected-help**.txt</exclude>
+ <exclude>src/it/help-basic**/**/expected-help**.txt</exclude>
</inputExcludes>
</configuration>
</plugin>
@@ -263,10 +263,6 @@
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
</properties>
- <pomExcludes>
- <pomExclude>plugin-info-jdk/pom.xml</pomExclude>
- <!-- relies on just a given plugin.xml for generating a
report, this is no longer supported -->
- </pomExcludes>
<extraArtifacts>
<!-- used in ITs -->
<extraArtifact>org.apache.maven.plugin-tools:maven-plugin-tools-annotations:${project.version}:jar:test-sources</extraArtifact>
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
deleted file mode 100644
index 8920e947..00000000
---
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/invoker.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-invoker.goals.1 = clean install
-invoker.goals.2 = --log-file help.log
org.apache.maven.its.plugin:help-deprecated-annotation-only:1.0-SNAPSHOT:help
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/test.properties
b/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/test.properties
deleted file mode 100644
index 16e4de3c..00000000
---
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/test.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-# 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.
-
-detail = true
-goal = test
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
b/maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/expected-help.txt
similarity index 100%
rename from
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/expected-help.txt
rename to
maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/expected-help.txt
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
b/maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/pom.xml
similarity index 100%
rename from
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/pom.xml
rename to
maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/pom.xml
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/src/main/java/test/MyMojo.java
b/maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/src/main/java/test/MyMojo.java
similarity index 100%
rename from
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/src/main/java/test/MyMojo.java
rename to
maven-plugin-plugin/src/it/help-basic/help-deprecated-annotation-only/src/main/java/test/MyMojo.java
diff --git a/maven-plugin-plugin/src/it/help-basic/expected-help.txt
b/maven-plugin-plugin/src/it/help-basic/help/expected-help.txt
similarity index 100%
rename from maven-plugin-plugin/src/it/help-basic/expected-help.txt
rename to maven-plugin-plugin/src/it/help-basic/help/expected-help.txt
diff --git a/maven-plugin-plugin/src/it/help-basic/pom.xml
b/maven-plugin-plugin/src/it/help-basic/help/pom.xml
similarity index 100%
copy from maven-plugin-plugin/src/it/help-basic/pom.xml
copy to maven-plugin-plugin/src/it/help-basic/help/pom.xml
diff --git
a/maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java
b/maven-plugin-plugin/src/it/help-basic/help/src/main/java/test/MyMojo.java
similarity index 100%
rename from maven-plugin-plugin/src/it/help-basic/src/main/java/test/MyMojo.java
rename to
maven-plugin-plugin/src/it/help-basic/help/src/main/java/test/MyMojo.java
diff --git a/maven-plugin-plugin/src/it/help-basic/invoker.properties
b/maven-plugin-plugin/src/it/help-basic/invoker.properties
index e7b0b4d6..bdc0c235 100644
--- a/maven-plugin-plugin/src/it/help-basic/invoker.properties
+++ b/maven-plugin-plugin/src/it/help-basic/invoker.properties
@@ -16,4 +16,5 @@
# under the License.
invoker.goals.1 = clean install
-invoker.goals.2 = --log-file help.log
org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
+invoker.goals.2 = --log-file help.log -pl help
org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
+invoker.goals.3 = --log-file help-deprecated-annotation-only.log -pl
help-deprecated-annotation-only
org.apache.maven.its.plugin:help-deprecated-annotation-only:1.0-SNAPSHOT:help
diff --git a/maven-plugin-plugin/src/it/help-basic/pom.xml
b/maven-plugin-plugin/src/it/help-basic/pom.xml
index f6cd0f12..c4431521 100644
--- a/maven-plugin-plugin/src/it/help-basic/pom.xml
+++ b/maven-plugin-plugin/src/it/help-basic/pom.xml
@@ -23,64 +23,17 @@ under the License.
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.maven.its.plugin</groupId>
- <artifactId>help</artifactId>
+ <artifactId>help-basic</artifactId>
<version>1.0-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
+ <packaging>pom</packaging>
<description>
- Tests generation and compilation of the help mojo.
+ Tests the generated help mojo of a plugin that documents its deprecations
with Javadoc tags (help)
+ and of one that uses the annotation only (help-deprecated-annotation-only).
</description>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>@maven3Version@</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <version>@project.version@</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>@version.maven-compiler-plugin@</version>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>@project.version@</version>
- <configuration>
- <goalPrefix>help</goalPrefix>
- </configuration>
- <executions>
- <execution>
- <id>default-descriptor</id>
- <phase>process-classes</phase>
- </execution>
- <execution>
- <id>help-goal</id>
- <goals>
- <goal>helpmojo</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <modules>
+ <module>help</module>
+ <module>help-deprecated-annotation-only</module>
+ </modules>
</project>
diff --git a/maven-plugin-plugin/src/it/help-basic/verify.groovy
b/maven-plugin-plugin/src/it/help-basic/verify.groovy
index eb4ad85c..e1bf7a07 100644
--- a/maven-plugin-plugin/src/it/help-basic/verify.groovy
+++ b/maven-plugin-plugin/src/it/help-basic/verify.groovy
@@ -17,12 +17,16 @@
* under the License.
*/
-expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r",
"" );
+// each module documents the same mojo; they differ in how the deprecations
are declared
+for ( String module in [ "help", "help-deprecated-annotation-only" ] )
+{
+ def expected = new File( basedir, "${module}/expected-help.txt"
).text.trim().replace( "\r", "" )
-log = new File( basedir, "help.log" ).text.replace( "\r", "" );
-log = log.substring( log.indexOf( "[INFO] help 1.0-SNAPSHOT" ) );
-log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim();
+ def log = new File( basedir, "${module}.log" ).text.replace( "\r", "" )
+ log = log.substring( log.indexOf( "[INFO] ${module} 1.0-SNAPSHOT" ) )
+ log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim()
-assert log == expected;
+ assert log == expected : "unexpected help output of ${module}"
+}
-return true;
\ No newline at end of file
+return true
diff --git
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
b/maven-plugin-plugin/src/it/mplugin-299_no-configuration/verify.groovy
similarity index 63%
rename from
maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
rename to maven-plugin-plugin/src/it/mplugin-299_no-configuration/verify.groovy
index 613385af..3ccedb35 100644
---
a/maven-plugin-plugin/src/it/help-basic-deprecated-annotation-only/verify.groovy
+++ b/maven-plugin-plugin/src/it/mplugin-299_no-configuration/verify.groovy
@@ -17,12 +17,11 @@
* under the License.
*/
-expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r",
"" )
+// help.log holds the output of the second invoker run: the goal and its
undocumented parameter must be listed
+def log = new File( basedir, "help.log" ).text.replace( "\r", "" )
-log = new File( basedir, "help.log" ).text.replace( "\r", "" )
-log = log.substring( log.indexOf( "[INFO] help-deprecated-annotation-only
1.0-SNAPSHOT" ) )
-log = log.substring( 0, log.indexOf( "[INFO]", 5 ) ).trim()
-
-assert log == expected
+assert log.contains( "[INFO] help 1.0-SNAPSHOT" ) : "help.log has no plugin
header"
+assert log =~ /(?m)^prefix:test$/ : "help.log does not describe the goal
prefix:test"
+assert log =~ /(?s)Available parameters:\s+empyAnnotatedParameter\s/ :
"help.log does not list the undocumented parameter"
return true
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
b/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
deleted file mode 100644
index f8d4fe55..00000000
--- a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- 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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.plugins.plugin.its</groupId>
- <artifactId>mplugin305</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
-
- <url>https://issues.apache.org/jira/browse/MPLUGIN-305</url>
-
- <properties>
- <mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>@maven3Version@</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <version>${mavenPluginPluginVersion}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>maven-surefire-common</artifactId>
- <version>2.19.1</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>@version.maven-compiler-plugin@</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>${mavenPluginPluginVersion}</version>
- <configuration>
- <extractors>
- <extractor>java-annotations</extractor>
- </extractors>
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- <goalPrefix>prefix</goalPrefix>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/invoker.properties
b/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/invoker.properties
deleted file mode 100644
index 2ae68688..00000000
---
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-invoker.goals.1 = clean process-classes
\ No newline at end of file
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
b/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
deleted file mode 100644
index 54765bcf..00000000
---
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * 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.
- */
-package org.apache.maven.plugins.plugin.it;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.maven.plugin.surefire.AbstractSurefireMojo;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.surefire.suite.RunResult;
-
-@Mojo(name = "custom-surefire")
-public class CustomSurefireMojo extends AbstractSurefireMojo {
-
- public File getBasedir() {
- return null;
- }
-
- public File getClassesDirectory() {
- return null;
- }
-
- public String getDebugForkedProcess() {
- return null;
- }
-
- public Boolean getFailIfNoSpecifiedTests() {
- return null;
- }
-
- public int getForkedProcessTimeoutInSeconds() {
- return 0;
- }
-
- public double getParallelTestsTimeoutForcedInSeconds() {
- return 0;
- }
-
- public double getParallelTestsTimeoutInSeconds() {
- return 0;
- }
-
- public String getReportFormat() {
- return null;
- }
-
- public File getReportsDirectory() {
- return null;
- }
-
- public String getShutdown() {
- return null;
- }
-
- public int getSkipAfterFailureCount() {
- return 0;
- }
-
- public String getTest() {
- return null;
- }
-
- public File getTestClassesDirectory() {
- return null;
- }
-
- public boolean isPrintSummary() {
- return false;
- }
-
- public boolean isSkip() {
- return false;
- }
-
- public boolean isSkipExec() {
- return false;
- }
-
- public boolean isSkipTests() {
- return false;
- }
-
- public boolean isUseFile() {
- return false;
- }
-
- public boolean isUseManifestOnlyJar() {
- return false;
- }
-
- public boolean isUseSystemClassLoader() {
- return false;
- }
-
- public void setBasedir(File arg0) {}
-
- public void setClassesDirectory(File arg0) {}
-
- public void setDebugForkedProcess(String arg0) {}
-
- public void setFailIfNoSpecifiedTests(boolean arg0) {}
-
- public void setForkedProcessTimeoutInSeconds(int arg0) {}
-
- public void setParallelTestsTimeoutForcedInSeconds(double arg0) {}
-
- public void setParallelTestsTimeoutInSeconds(double arg0) {}
-
- public void setPrintSummary(boolean arg0) {}
-
- public void setReportFormat(String arg0) {}
-
- public void setReportsDirectory(File arg0) {}
-
- public void setSkip(boolean arg0) {}
-
- public void setSkipExec(boolean arg0) {}
-
- public void setSkipTests(boolean arg0) {}
-
- public void setTest(String arg0) {}
-
- public void setTestClassesDirectory(File arg0) {}
-
- public void setUseFile(boolean arg0) {}
-
- public void setUseManifestOnlyJar(boolean arg0) {}
-
- public void setUseSystemClassLoader(boolean arg0) {}
-
- @Override
- protected String[] getDefaultIncludes() {
- return null;
- }
-
- @Override
- public File getExcludesFile() {
- return null;
- }
-
- @Override
- public List<String> getIncludes() {
- return null;
- }
-
- @Override
- public File getIncludesFile() {
- return null;
- }
-
- @Override
- protected String getPluginName() {
- return null;
- }
-
- @Override
- protected int getRerunFailingTestsCount() {
- return 0;
- }
-
- @Override
- public String getRunOrder() {
- return null;
- }
-
- @Override
- public File[] getSuiteXmlFiles() {
- return null;
- }
-
- @Override
- protected void handleSummary(RunResult arg0, Exception arg1) {}
-
- @Override
- protected boolean hasSuiteXmlFiles() {
- return false;
- }
-
- @Override
- protected boolean isSkipExecution() {
- return false;
- }
-
- @Override
- public void setIncludes(List<String> arg0) {}
-
- @Override
- public void setRunOrder(String arg0) {}
-
- @Override
- public void setSuiteXmlFiles(File[] arg0) {}
-
- @Override
- protected List<File> suiteXmlFiles() {
- return null;
- }
-}
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/verify.groovy
b/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/verify.groovy
deleted file mode 100644
index 71853898..00000000
--- a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/verify.groovy
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 groovy.xml.XmlParser
-
-File descriptorFile = new File( basedir,
"target/classes/META-INF/maven/plugin.xml" );
-assert descriptorFile.isFile()
-
-def pluginDescriptor = new XmlParser().parse( descriptorFile );
-
-assert pluginDescriptor.mojos.mojo.size() == 1
-assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 0
-
-return true;
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/invoker.properties
b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/invoker.properties
similarity index 73%
rename from
maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/invoker.properties
rename to
maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/invoker.properties
index 2ae68688..2d89ca0c 100644
---
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/invoker.properties
+++ b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/invoker.properties
@@ -15,4 +15,7 @@
# specific language governing permissions and limitations
# under the License.
-invoker.goals.1 = clean process-classes
\ No newline at end of file
+# one run per variant of the same plugin: each writes
target/<variant>/classes/META-INF/maven/plugin.xml
+invoker.goals.1 = clean process-classes -PdefaultMojoDependencies
+invoker.goals.2 = process-classes -PemptyMojoDependencies
+invoker.goals.3 = process-classes -PsingleMojoDependencies
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/pom.xml
similarity index 65%
rename from maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
rename to maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/pom.xml
index da001f35..7fda498c 100644
--- a/maven-plugin-plugin/src/it/mplugin-305_emptyMojoDependencies/pom.xml
+++ b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/pom.xml
@@ -30,6 +30,8 @@
<properties>
<mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <surefireVersion>2.19.1</surefireVersion>
+ <mojoSources>src/main/java</mojoSources>
</properties>
<dependencies>
@@ -48,11 +50,12 @@
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>maven-surefire-common</artifactId>
- <version>2.19.1</version>
+ <version>${surefireVersion}</version>
</dependency>
</dependencies>
<build>
+ <sourceDirectory>${mojoSources}</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -76,12 +79,56 @@
<goals>
<goal>descriptor</goal>
</goals>
- <configuration>
- <mojoDependencies/>
- </configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <!-- Each run writes its descriptor into its own build directory, so that
verify.groovy sees all three. -->
+ <profile>
+ <id>defaultMojoDependencies</id>
+ <build>
+ <directory>${project.basedir}/target/default</directory>
+ </build>
+ </profile>
+ <profile>
+ <id>emptyMojoDependencies</id>
+ <build>
+ <directory>${project.basedir}/target/empty</directory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <mojoDependencies/>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>singleMojoDependencies</id>
+ <properties>
+ <surefireVersion>3.1.0</surefireVersion>
+ <!-- written against the surefire 3.1.0 API -->
+ <mojoSources>src/single/java</mojoSources>
+ </properties>
+ <build>
+ <directory>${project.basedir}/target/single</directory>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <mojoDependencies>
+
<mojoDependency>org.apache.maven.surefire:maven-surefire-common</mojoDependency>
+ </mojoDependencies>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
</project>
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
similarity index 100%
rename from
maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
rename to
maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/src/single/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
similarity index 100%
rename from
maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/src/main/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
rename to
maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/src/single/java/org/apache/maven/plugins/plugin/it/CustomSurefireMojo.java
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/verify.groovy
b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/verify.groovy
similarity index 53%
rename from
maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/verify.groovy
rename to maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/verify.groovy
index 3ad89eb5..651d54c8 100644
---
a/maven-plugin-plugin/src/it/mplugin-305_defaultMojoDependencies/verify.groovy
+++ b/maven-plugin-plugin/src/it/mplugin-305_mojoDependencies/verify.groovy
@@ -17,12 +17,19 @@
import groovy.xml.XmlParser
-File descriptorFile = new File( basedir,
"target/classes/META-INF/maven/plugin.xml" );
-assert descriptorFile.isFile()
+def parameterCount = { String variant ->
+ File descriptorFile = new File( basedir,
"target/${variant}/classes/META-INF/maven/plugin.xml" )
+ assert descriptorFile.isFile() : "no plugin descriptor for ${variant}"
+ def pluginDescriptor = new XmlParser().parse( descriptorFile )
+ assert pluginDescriptor.mojos.mojo.size() == 1
+ return pluginDescriptor.mojos.mojo.parameters.parameter.size()
+}
-def pluginDescriptor = new XmlParser().parse( descriptorFile );
+// no <mojoDependencies>: every dependency is scanned for inherited parameters
+assert parameterCount( "default" ) == 48
+// <mojoDependencies/>: no dependency is scanned
+assert parameterCount( "empty" ) == 0
+// a single entry: only maven-surefire-common (3.1.0) is scanned
+assert parameterCount( "single" ) == 51
-assert pluginDescriptor.mojos.mojo.size() == 1
-assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 48
-
-return true;
+return true
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/invoker.properties
b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/invoker.properties
deleted file mode 100644
index 2ae68688..00000000
---
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/invoker.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# 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.
-
-invoker.goals.1 = clean process-classes
\ No newline at end of file
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
deleted file mode 100644
index c5d47640..00000000
--- a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/pom.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- 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.
--->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.apache.maven.plugins.plugin.its</groupId>
- <artifactId>mplugin305</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>maven-plugin</packaging>
-
- <url>https://issues.apache.org/jira/browse/MPLUGIN-305</url>
-
- <properties>
- <mavenPluginPluginVersion>@project.version@</mavenPluginPluginVersion>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-api</artifactId>
- <version>@maven3Version@</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.plugin-tools</groupId>
- <artifactId>maven-plugin-annotations</artifactId>
- <version>${mavenPluginPluginVersion}</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.surefire</groupId>
- <artifactId>maven-surefire-common</artifactId>
- <version>3.1.0</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>@version.maven-compiler-plugin@</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>${mavenPluginPluginVersion}</version>
- <configuration>
- <extractors>
- <extractor>java-annotations</extractor>
- </extractors>
- <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
- <mojoDependencies>
-
<mojoDependency>org.apache.maven.surefire:maven-surefire-common</mojoDependency>
- </mojoDependencies>
- <goalPrefix>prefix</goalPrefix>
- </configuration>
- <executions>
- <execution>
- <id>mojo-descriptor</id>
- <goals>
- <goal>descriptor</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
b/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
deleted file mode 100644
index 61e3005e..00000000
---
a/maven-plugin-plugin/src/it/mplugin-305_singleMojoDependencies/verify.groovy
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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 groovy.xml.XmlParser
-
-File descriptorFile = new File( basedir,
"target/classes/META-INF/maven/plugin.xml" );
-assert descriptorFile.isFile()
-
-def pluginDescriptor = new XmlParser().parse( descriptorFile );
-
-assert pluginDescriptor.mojos.mojo.size() == 1
-assert pluginDescriptor.mojos.mojo.parameters.parameter.size() == 51
-
-return true;