Compare commits
125 Commits
maven-plug
...
master
| Author | SHA1 | Date |
|---|---|---|
|
|
7fcab60985 | |
|
|
d682b25820 | |
|
|
a7fc242de5 | |
|
|
8d1ba27e95 | |
|
|
f99796ee68 | |
|
|
a3371bc6fb | |
|
|
e564b8d54d | |
|
|
d38ef497bc | |
|
|
92f5eaaa3d | |
|
|
d484f85160 | |
|
|
04684f0fc3 | |
|
|
e44bb78aff | |
|
|
1f70e4ea47 | |
|
|
3ec7f6f61d | |
|
|
bcf94564ba | |
|
|
6fda7882f1 | |
|
|
e430efe682 | |
|
|
e598cdfd30 | |
|
|
053932347f | |
|
|
81eb53a1c5 | |
|
|
49349dee7a | |
|
|
f50e9ebb58 | |
|
|
117eaf66a5 | |
|
|
365f900755 | |
|
|
d49dbb8b79 | |
|
|
89a82c2963 | |
|
|
f223b01735 | |
|
|
2767d04ccb | |
|
|
5e063a0907 | |
|
|
4bd90ea35f | |
|
|
4ac5b187dc | |
|
|
3aaa8d275c | |
|
|
e0fe0f017f | |
|
|
176760d3f9 | |
|
|
197e306311 | |
|
|
79490bad16 | |
|
|
52c7bcc7c0 | |
|
|
15180d93b0 | |
|
|
c20a5f300b | |
|
|
f0d7f725a4 | |
|
|
629dd38f3d | |
|
|
ec99a5982d | |
|
|
6992f7719b | |
|
|
9963ca473d | |
|
|
dacb6e6b6d | |
|
|
9a7fd1e70d | |
|
|
34920f0a2c | |
|
|
7c58d51900 | |
|
|
372526b052 | |
|
|
22fcf70b89 | |
|
|
a44d4f1719 | |
|
|
7dd7d23ebf | |
|
|
250f72677d | |
|
|
8fd7093a5c | |
|
|
1525c61b93 | |
|
|
51a8d562ad | |
|
|
7b952b87a3 | |
|
|
547e3868c7 | |
|
|
257e61a72e | |
|
|
e982dbf1c6 | |
|
|
6edd624afc | |
|
|
cc006dbd8e | |
|
|
0fec67e0eb | |
|
|
4b16f1d883 | |
|
|
267e446889 | |
|
|
e3b6db6b40 | |
|
|
45a627148b | |
|
|
4eaf2678a2 | |
|
|
8e51a50e0b | |
|
|
bfc52d95df | |
|
|
5ab96a0efb | |
|
|
e8dfae0cbc | |
|
|
b622b0198e | |
|
|
409d56c504 | |
|
|
7fdabadb3c | |
|
|
75987012b1 | |
|
|
7a2ed415cd | |
|
|
732b82b2da | |
|
|
3b54fdbc28 | |
|
|
4167674992 | |
|
|
7500654003 | |
|
|
3394354af1 | |
|
|
7426d551af | |
|
|
35ca9b5a80 | |
|
|
0f464acc12 | |
|
|
fa0a5fc105 | |
|
|
99359ef1b6 | |
|
|
b0fd53aaa7 | |
|
|
d988e0b43c | |
|
|
1089b54c3f | |
|
|
6984e9d27f | |
|
|
5af1f627a8 | |
|
|
de5875e0af | |
|
|
9e1a66d448 | |
|
|
b13ad1288e | |
|
|
bdb03e597c | |
|
|
1f029f5fb1 | |
|
|
5c7faf1b8e | |
|
|
599b468d0d | |
|
|
a1b3723559 | |
|
|
66444b15df | |
|
|
311aa09218 | |
|
|
58a8f57588 | |
|
|
f516f754c5 | |
|
|
f10b51e352 | |
|
|
936f421eab | |
|
|
7bc6873931 | |
|
|
045ab59621 | |
|
|
1190048b92 | |
|
|
f8c4b373e7 | |
|
|
00288684b1 | |
|
|
4dc8598822 | |
|
|
e1fb52356f | |
|
|
2aa4a2c9cd | |
|
|
e0b306c105 | |
|
|
3bb1fbf154 | |
|
|
f36105f19c | |
|
|
a2602cf139 | |
|
|
f0a8bb4b3a | |
|
|
4e00ec6fc3 | |
|
|
f224aa88c6 | |
|
|
bb948bfbc8 | |
|
|
660e74e052 | |
|
|
b0b5558bc0 | |
|
|
ebf0b9465e |
|
|
@ -0,0 +1 @@
|
|||
asfMavenStdBuild(javaVersions:['8','7'])
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.3</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
|
|
|
|||
|
|
@ -52,13 +52,13 @@ public @interface Mojo
|
|||
|
||||
/**
|
||||
* the required dependency resolution scope.
|
||||
* @return
|
||||
* @return the required dependency resolution scope
|
||||
*/
|
||||
ResolutionScope requiresDependencyResolution() default ResolutionScope.NONE;
|
||||
|
||||
/**
|
||||
* the required dependency collection scope.
|
||||
* @return
|
||||
* @return the required dependency collection scope
|
||||
*/
|
||||
ResolutionScope requiresDependencyCollection() default ResolutionScope.NONE;
|
||||
|
||||
|
|
@ -76,31 +76,31 @@ public @interface Mojo
|
|||
|
||||
/**
|
||||
* does your mojo requires a project to be executed?
|
||||
* @return
|
||||
* @return requires a project
|
||||
*/
|
||||
boolean requiresProject() default true;
|
||||
|
||||
/**
|
||||
* does your mojo requires a reporting context to be executed?
|
||||
* @return
|
||||
* @return requires a reporting context
|
||||
*/
|
||||
boolean requiresReports() default false;
|
||||
|
||||
/**
|
||||
* if the Mojo uses the Maven project and its child modules.
|
||||
* @return
|
||||
* @return uses the Maven project and its child modules
|
||||
*/
|
||||
boolean aggregator() default false;
|
||||
|
||||
/**
|
||||
* can this Mojo be invoked directly only?
|
||||
* @return
|
||||
* @return invoked directly only
|
||||
*/
|
||||
boolean requiresDirectInvocation() default false;
|
||||
|
||||
/**
|
||||
* does this Mojo need to be online to be executed?
|
||||
* @return
|
||||
* @return need to be online
|
||||
*/
|
||||
boolean requiresOnline() default false;
|
||||
|
||||
|
|
@ -108,13 +108,13 @@ public @interface Mojo
|
|||
|
||||
/**
|
||||
* own configurator class.
|
||||
* @return
|
||||
* @return own configurator class
|
||||
*/
|
||||
String configurator() default "";
|
||||
|
||||
/**
|
||||
* is your mojo thread safe (since Maven 3.x)?
|
||||
* @return
|
||||
* @return is thread safe
|
||||
*/
|
||||
boolean threadSafe() default false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ public @interface Parameter
|
|||
String alias() default "";
|
||||
|
||||
/**
|
||||
* Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom properties.
|
||||
* Property to use to retrieve a value. Can come from <code>-D</code> execution, setting properties or pom
|
||||
* properties.
|
||||
* @return property name
|
||||
*/
|
||||
String property() default "";
|
||||
|
|
|
|||
|
|
@ -33,17 +33,6 @@ About ${project.name}
|
|||
* Usage
|
||||
|
||||
To be able to {{{../maven-plugin-tools-annotations/index.html}use Maven Plugin Tools Java 5 Annotations}},
|
||||
add this artifact to your project dependencies in <<<pom.xml>>>:
|
||||
|
||||
+--------+
|
||||
<project>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
+--------+
|
||||
some configuration has to be done in <<<pom.xml>>>: see
|
||||
{{{../maven-plugin-plugin/examples/using-annotations.html#POM_configuration} Using Plugin Tools Java5 Annotations}}
|
||||
example in {{{../maven-plugin-plugin} <<<maven-plugin-plugin>>>}} documentation.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<version>3.3</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
@ -38,20 +38,46 @@
|
|||
</description>
|
||||
|
||||
<prerequisites>
|
||||
<maven>2.0.6</maven>
|
||||
<maven>2.2.1</maven>
|
||||
</prerequisites>
|
||||
|
||||
<properties>
|
||||
<doxiaVersion>1.2</doxiaVersion>
|
||||
<doxia-sitetoolsVersion>1.2</doxia-sitetoolsVersion>
|
||||
<doxiaVersion>1.4</doxiaVersion>
|
||||
<doxia-sitetoolsVersion>1.4</doxia-sitetoolsVersion>
|
||||
<it.debug>true</it.debug>
|
||||
<mavenPluginPluginVersion>3.1</mavenPluginPluginVersion>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-generators</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- runtime extractors used by default by plugin-tools -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- for source code annotations of the mojos -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<!-- from stricter view, should use ${mavenPluginToolsVersion} but this is causing problems with release plugin -->
|
||||
<!--version>${mavenPluginToolsVersion}</version-->
|
||||
<!--
|
||||
Do not use 'provided' scope here. The annotations are a transitive dependency of
|
||||
'maven-plugin-tools-annotations' which fails to load at runtime when not available.
|
||||
-->
|
||||
</dependency>
|
||||
|
||||
<!-- doxia -->
|
||||
|
|
@ -76,7 +102,7 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- maven -->
|
||||
<!-- Maven -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
|
|
@ -103,15 +129,6 @@
|
|||
<artifactId>maven-plugin-registry</artifactId>
|
||||
<version>${mavenVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-generators</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-artifact-manager</artifactId>
|
||||
|
|
@ -126,7 +143,7 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.maven.reporting</groupId>
|
||||
<artifactId>maven-reporting-impl</artifactId>
|
||||
<version>2.1</version><!-- 2.2 causes IT failure with mvn 2.2.1 -->
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.reporting</groupId>
|
||||
|
|
@ -134,23 +151,6 @@
|
|||
<version>3.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Maven runtime -->
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-beanshell</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-model</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- plexus -->
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
|
|
@ -167,6 +167,13 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.surefire</groupId>
|
||||
<artifactId>maven-surefire-common</artifactId>
|
||||
<version>2.19.1</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- other -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
|
|
@ -190,6 +197,29 @@
|
|||
</dependencies>
|
||||
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/filtered-resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.rat</groupId>
|
||||
<artifactId>apache-rat-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes combine.children="append">
|
||||
<!-- This file should exactly match the output of this project -->
|
||||
<exclude>src/it/help-basic/expected-help.txt</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.modello</groupId>
|
||||
|
|
@ -234,21 +264,21 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<version>3.5</version>
|
||||
<!-- will use previous maven-plugin-plugin release to build current maven-plugin-plugin as configured in parent -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
<id>default-descriptor</id>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>generated-helpmojo</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
|
@ -260,7 +290,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>3.2</version>
|
||||
<version>3.3</version><!-- cannot use ${mavenPluginToolsVersion} property because release plugin would try to update -->
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
|
|
@ -342,6 +372,10 @@
|
|||
<sitePluginVersion>3.3</sitePluginVersion>
|
||||
<antVersion>${antVersion}</antVersion>
|
||||
</filterProperties>
|
||||
<properties>
|
||||
<maven.compiler.source>${maven.compiler.source}</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.target}</maven.compiler.target>
|
||||
</properties>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
|
@ -355,14 +389,35 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>maven-2</id>
|
||||
<activation>
|
||||
<file>
|
||||
<!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
|
||||
<missing>${basedir}</missing>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- see https://issues.apache.org/jira/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -62,6 +62,13 @@ under the License.
|
|||
<version>@project.version@</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-compiler-manager</artifactId>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.apache.maven.plugins.annotations.Execute;
|
|||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.tools.plugin.annotations.FooMojo;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.FooMojo;
|
||||
import org.apache.maven.project.MavenProjectHelper;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -50,6 +50,13 @@ under the License.
|
|||
<version>@project.version@</version>
|
||||
<classifier>tests</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<!-- dependency of org.apache.maven.plugin-tools:maven-plugin-tools-annotations:@project.version@:jar:tests -->
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-project</artifactId>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
invoker.maven.version = 3.0+
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
invoker.goals.3 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
# --log-file option is only supported by Maven 3
|
||||
invoker.maven.version = 3.0+
|
||||
|
|
|
|||
|
|
@ -46,6 +46,12 @@ under the License.
|
|||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
@ -64,6 +70,10 @@ under the License.
|
|||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-descriptor</id>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-goal</id>
|
||||
<goals>
|
||||
|
|
|
|||
|
|
@ -20,15 +20,17 @@ package test;
|
|||
*/
|
||||
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
/**
|
||||
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
|
||||
* inline link to {@link test.AnotherMojo}.
|
||||
*
|
||||
* @goal test
|
||||
* @deprecated As of 1.0, use the "quoted" goal instead.
|
||||
* @since 2.1
|
||||
*/
|
||||
@Mojo( name= "test" )
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
|
@ -37,31 +39,26 @@ public class MyMojo
|
|||
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
|
||||
* escaped in Java string literals.
|
||||
*
|
||||
* @parameter default-value="escape\\backslash"
|
||||
* @since 2.0
|
||||
*/
|
||||
@Parameter( defaultValue = "escape\\backslash" )
|
||||
private String defaultParam;
|
||||
|
||||
/**
|
||||
* This parameter is deprecated.
|
||||
*
|
||||
* @parameter
|
||||
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
||||
*/
|
||||
@Parameter
|
||||
private String deprecatedParam;
|
||||
|
||||
/**
|
||||
* @parameter expression="${test.undocumented}"
|
||||
* @required
|
||||
*/
|
||||
@Parameter( property = "test.undocumented", required = true )
|
||||
private String undocumentedParam;
|
||||
|
||||
/**
|
||||
* Readonly parameter: should not be proposed for configuration.
|
||||
*
|
||||
* @parameter default-value="not for configuration"
|
||||
* @readonly
|
||||
*/
|
||||
@Parameter( defaultValue = "not for configuration", readonly = true )
|
||||
private String readonly;
|
||||
|
||||
public void execute()
|
||||
|
|
|
|||
|
|
@ -17,9 +17,9 @@
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
expected = new File( basedir, "expected-help.txt" ).text.trim();
|
||||
expected = new File( basedir, "expected-help.txt" ).text.trim().replace( "\r", "" );
|
||||
|
||||
log = new File( basedir, "help.log" ).text;
|
||||
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();
|
||||
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ under the License.
|
|||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<!-- pom properties values not taken into account since invoker defines properties -->
|
||||
<!-- that override what's defined in pom -->
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
|
|
@ -70,7 +72,11 @@ under the License.
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source><!-- avoid ${maven.compiler.source} since value is not as expected -->
|
||||
<target>1.8</target><!-- avoid ${maven.compiler.target} since value is not as expected -->
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package fr.ca;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
public interface TestInterface {
|
||||
|
||||
/**
|
||||
* Java 8 required to support such default method implementation
|
||||
*/
|
||||
public default void foo(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,47 +1,47 @@
|
|||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
package org.apache.maven.plugin.coreit;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Could not use regex in @Parameter(defaultValue)
|
||||
*/
|
||||
@Mojo( name = "mplugin-220" )
|
||||
public class MPlugin220Mojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
@Parameter( defaultValue = "[a-zA-Z]{2,}-\\\\d+" )
|
||||
private String regex;
|
||||
|
||||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
getLog().info( "regex = " + regex );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,33 +51,34 @@ assert mojo.configuration.touchFile[0].text() == '${first.touchFile}'
|
|||
assert mojo.configuration.touchFile[0].'@implementation' == 'java.io.File'
|
||||
assert mojo.configuration.touchFile[0].'@default-value' == '${project.build.directory}/touch.txt'
|
||||
|
||||
assert mojo.configuration.session[0].text() == ''
|
||||
assert mojo.configuration.session[0].'@implementation' == 'org.apache.maven.execution.MavenSession'
|
||||
assert mojo.configuration.session[0].'@default-value' == '${session}'
|
||||
assert mojo.requirements.requirement.size() == 6
|
||||
|
||||
assert mojo.configuration.project[0].text() == ''
|
||||
assert mojo.configuration.project[0].'@implementation' == 'org.apache.maven.project.MavenProject'
|
||||
assert mojo.configuration.project[0].'@default-value' == '${project}'
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "session" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.execution.MavenSession'
|
||||
assert requirement.'field-name'.text() == 'session'
|
||||
|
||||
assert mojo.configuration.mojo[0].text() == ''
|
||||
assert mojo.configuration.mojo[0].'@implementation' == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert mojo.configuration.mojo[0].'@default-value' == '${mojoExecution}'
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "project" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProject'
|
||||
assert requirement.'field-name'.text() == 'project'
|
||||
|
||||
assert mojo.configuration.plugin[0].text() == ''
|
||||
assert mojo.configuration.plugin[0].'@implementation' == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert mojo.configuration.plugin[0].'@default-value' == '${plugin}'
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "mojo" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert requirement.'field-name'.text() == 'mojo'
|
||||
|
||||
assert mojo.configuration.settings[0].text() == ''
|
||||
assert mojo.configuration.settings[0].'@implementation' == 'org.apache.maven.settings.Settings'
|
||||
assert mojo.configuration.settings[0].'@default-value' == '${settings}'
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "plugin" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert requirement.'field-name'.text() == 'plugin'
|
||||
|
||||
assert mojo.requirements.requirement.size() == 1
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "settings" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.settings.Settings'
|
||||
assert requirement.'field-name'.text() == 'settings'
|
||||
|
||||
assert mojo.requirements.requirement[0].role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
assert mojo.requirements.requirement[0].'role-hint'.text() == 'test'
|
||||
assert mojo.requirements.requirement[0].'field-name'.text() == 'projectHelper'
|
||||
requirement = mojo.requirements.requirement.findAll{ it.'field-name'.text() == "projectHelper" }[0]
|
||||
assert requirement.role.text() == 'org.apache.maven.project.MavenProjectHelper'
|
||||
assert requirement.'role-hint'.text() == 'test'
|
||||
assert requirement.'field-name'.text() == 'projectHelper'
|
||||
|
||||
assert mojo.parameters.parameter.size() == 8
|
||||
assert mojo.parameters.parameter.size() == 3
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "namedParam" }[0]
|
||||
assert parameter.name.text() == 'namedParam'
|
||||
|
|
@ -97,51 +98,6 @@ assert parameter.required.text() == 'false'
|
|||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == 'Project directory.'
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "mojo" }[0]
|
||||
assert parameter.name.text() == 'mojo'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.MojoExecution'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "plugin" }[0]
|
||||
assert parameter.name.text() == 'plugin'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.plugin.descriptor.PluginDescriptor'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "project" }[0]
|
||||
assert parameter.name.text() == 'project'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.project.MavenProject'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "session" }[0]
|
||||
assert parameter.name.text() == 'session'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.execution.MavenSession'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "settings" }[0]
|
||||
assert parameter.name.text() == 'settings'
|
||||
assert parameter.alias.isEmpty()
|
||||
assert parameter.type.text() == 'org.apache.maven.settings.Settings'
|
||||
assert parameter.deprecated.isEmpty()
|
||||
assert parameter.required.text() == 'true'
|
||||
assert parameter.editable.text() == 'false'
|
||||
assert parameter.description.text() == ''
|
||||
|
||||
parameter = mojo.parameters.parameter.findAll{ it.name.text() == "touchFile" }[0]
|
||||
assert parameter.name.text() == 'touchFile'
|
||||
assert parameter.alias.isEmpty()
|
||||
|
|
|
|||
|
|
@ -1,18 +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.
|
||||
|
||||
invoker.goals = clean plugin:report -DskipTests
|
||||
# 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 = clean plugin:report -DskipTests
|
||||
|
|
|
|||
|
|
@ -1,45 +1,45 @@
|
|||
<?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>mplugin-187</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<description>Verify that plugin:report succeeds</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<?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>mplugin-187</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<description>Verify that plugin:report succeeds</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,18 +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.
|
||||
|
||||
invoker.goals = clean compile plugin:report
|
||||
# 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 = clean compile plugin:report
|
||||
|
|
|
|||
|
|
@ -1,81 +1,81 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*/
|
||||
@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
*/
|
||||
@Parameter(defaultValue = "${project.build.directory}", required = true)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Goal which touches a timestamp file.
|
||||
*/
|
||||
@Mojo(name = "touch", defaultPhase = LifecyclePhase.PROCESS_RESOURCES)
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
/**
|
||||
* Location of the file.
|
||||
*/
|
||||
@Parameter(defaultValue = "${project.build.directory}", required = true)
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File pluginInfo = new File( basedir, "target/site/plugin-info.html" );
|
||||
assert pluginInfo.isFile()
|
||||
|
||||
File touchMojo = new File( basedir, "target/generated-site/xdoc/touch-mojo.xml" );
|
||||
assert touchMojo.isFile()
|
||||
|
||||
return true;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File pluginInfo = new File( basedir, "target/site/plugin-info.html" );
|
||||
assert pluginInfo.isFile()
|
||||
|
||||
File touchMojo = new File( basedir, "target/generated-site/xdoc/touch-mojo.xml" );
|
||||
assert touchMojo.isFile()
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
# 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.java.version = 1.8+
|
||||
invoker.goals.1 = clean verify
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
<?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>test-plugin</groupId>
|
||||
<artifactId>test-plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>3.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<goalPrefix>FOO</goalPrefix>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
</configuration>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>help-descriptor</id>
|
||||
<goals>
|
||||
<goal>helpmojo</goal>
|
||||
</goals>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package fr.ca;
|
||||
|
||||
/*
|
||||
* 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 org.apache.maven.plugin.MojoFailureException;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
|
||||
/**
|
||||
* Created by clement.agarini on 04/08/14.
|
||||
*/
|
||||
@Mojo(name="test-plugin",defaultPhase = LifecyclePhase.GENERATE_SOURCES)
|
||||
public class MyMojo extends AbstractMojo {
|
||||
@Override
|
||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package fr.ca;
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
public interface TestInterface {
|
||||
|
||||
/**
|
||||
* Java 8 required to support such default method implementation
|
||||
*/
|
||||
public default void foo(){
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# 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.maven.version = 3.0+
|
||||
invoker.goals.1 = clean install -DskipTests
|
||||
invoker.goals.2 = --log-file help.log org.apache.maven.its.plugin:help:1.0-SNAPSHOT:help
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<?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.its.plugin</groupId>
|
||||
<artifactId>help</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>
|
||||
Tests generation and compilation of the help mojo.
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</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>2.4</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<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>
|
||||
</project>
|
||||
|
|
@ -1,57 +1,37 @@
|
|||
package org.apache.maven.plugin.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.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.tools.plugin.generator.Generator;
|
||||
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Generate Xdoc files for the project mojos or goals.
|
||||
*
|
||||
* @author <a href="mailto:brett@apache.org">Brett Porter</a>
|
||||
* @version $Id$
|
||||
* @since 2.0
|
||||
*/
|
||||
@Mojo( name = "xdoc", threadSafe = true )
|
||||
public class XdocGeneratorMojo
|
||||
extends AbstractGeneratorMojo
|
||||
{
|
||||
/**
|
||||
* The directory where the generated Xdoc files will be put.
|
||||
*/
|
||||
@Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
|
||||
protected File outputDirectory;
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected File getOutputDirectory()
|
||||
{
|
||||
return outputDirectory;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
protected Generator createGenerator()
|
||||
{
|
||||
return new PluginXdocGenerator( project );
|
||||
}
|
||||
}
|
||||
package test;
|
||||
|
||||
/*
|
||||
* 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.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
@Mojo( name= "test" )
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
@Parameter
|
||||
private String empyAnnotatedParameter;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# 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
|
||||
|
|
@ -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.
|
||||
|
||||
invoker.goals.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<?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>2.2.1</version>
|
||||
</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>2.4</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>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
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() == 50
|
||||
|
||||
return true;
|
||||
|
|
@ -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.
|
||||
|
||||
invoker.goals.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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>2.2.1</version>
|
||||
</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>2.4</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>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<mojoDependencies/>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
|
@ -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.
|
||||
|
||||
invoker.goals.1 = clean process-classes
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
<?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>2.2.1</version>
|
||||
</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>2.4</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>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
package org.apache.maven.plugins.plugin.it;
|
||||
|
||||
/*
|
||||
* 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 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
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() == 50
|
||||
|
||||
return true;
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# 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 = clean plugin:report
|
||||
invoker.mavenOpts = -Duser.language=en -Duser.country=US -Duser.variant=US
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
<?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.its.plugin</groupId>
|
||||
<artifactId>report-since</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>@sitePluginVersion@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package org;
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
||||
/**
|
||||
* Does nothing.
|
||||
*
|
||||
* @goal noop
|
||||
* @phase process-sources
|
||||
* @requiresDependencyResolution test
|
||||
* @requiresDirectInvocation true
|
||||
* @requiresOnline
|
||||
* @inheritByDefault false
|
||||
* @execute phase="compile"
|
||||
* @aggregator
|
||||
* @since 1.0
|
||||
*
|
||||
* @deprecated You don't use test goals, do you?
|
||||
*/
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* This is a test.
|
||||
*
|
||||
* @parameter
|
||||
* @required
|
||||
*/
|
||||
@SuppressWarnings( "unused" )
|
||||
private String required;
|
||||
|
||||
/**
|
||||
* This is a test.
|
||||
*
|
||||
* @parameter expression="${string}" default-value="${project.version}/</markup-must-be-escaped>"
|
||||
* @deprecated Just testing.
|
||||
* @since 1.1
|
||||
*/
|
||||
@SuppressWarnings( "unused" )
|
||||
private String string;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
// intentional do nothing
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
assert new File( basedir, 'target/generated-site' ).exists()
|
||||
|
||||
content = new File( basedir, 'target/generated-site/xdoc/noop-mojo.xml' ).text
|
||||
|
||||
assert content.contains( '<li><strong>Since</strong>: <code>1.0</code></li>' )
|
||||
assert content.contains( '<li><strong>Since</strong>: <code>1.1</code></li>' )
|
||||
|
||||
return true
|
||||
|
|
@ -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.
|
||||
|
||||
invoker.goals = process-classes javadoc:javadoc
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
<?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>mplugin3224</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<description>
|
||||
Generation javadoc for private methods should be valid
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
<version>3.0.1</version>
|
||||
</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>2.4</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.0.0-M1</version>
|
||||
<configuration>
|
||||
<level>private</level>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<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>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package test;
|
||||
|
||||
/*
|
||||
* 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.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
||||
/**
|
||||
* MOJO-DESCRIPTION. Some "quotation" marks and backslashes '\\', some <strong>important</strong> javadoc<br> and an
|
||||
* inline link to {@link org.apache.maven.plugin.AbstractMojo}.
|
||||
*
|
||||
* @deprecated As of 1.0, use the "quoted" goal instead.
|
||||
* @since 2.1
|
||||
*/
|
||||
@Mojo( name= "test" )
|
||||
public class MyMojo
|
||||
extends AbstractMojo
|
||||
{
|
||||
|
||||
/**
|
||||
* This parameter uses "quotation" marks and backslashes '\\' in its description. Those characters <em>must</em> be
|
||||
* escaped in Java string literals.
|
||||
*
|
||||
* @since 2.0
|
||||
*/
|
||||
@Parameter( defaultValue = "escape\\backslash" )
|
||||
private String defaultParam;
|
||||
|
||||
/**
|
||||
* This parameter is deprecated.
|
||||
*
|
||||
* @deprecated As of version 1.0, use the {@link #defaultParam} instead.
|
||||
*/
|
||||
@Parameter
|
||||
private String deprecatedParam;
|
||||
|
||||
@Parameter( property = "test.undocumented", required = true )
|
||||
private String undocumentedParam;
|
||||
|
||||
/**
|
||||
* Readonly parameter: should not be proposed for configuration.
|
||||
*/
|
||||
@Parameter( defaultValue = "not for configuration", readonly = true )
|
||||
private String readonly;
|
||||
|
||||
public void execute()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -15,4 +15,4 @@
|
|||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
invoker.goals = clean site -DskipTests
|
||||
invoker.goals = clean plugin:report
|
||||
|
|
|
|||
|
|
@ -74,6 +74,13 @@ under the License.
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
invoker.goals = clean site
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>plugin</artifactId>
|
||||
<name>target bytecode defined by plugin configuration</name>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<properties><!-- will be overridden -->
|
||||
<maven.compiler.source>1.3</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration><!-- will be overridden -->
|
||||
<source>1.4</source>
|
||||
<target>1.4</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<name>target bytecode defined by plugin configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>plugin</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix></goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>pluginManagement</artifactId>
|
||||
<name>target bytecode defined by pluginManagement configuration</name>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<properties><!-- will be overridden -->
|
||||
<maven.compiler.source>1.3</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.4</source>
|
||||
<target>1.4</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<name>target bytecode defined by pluginManagement configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>pluginManagement</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>Management</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
<?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.its.plugin-info-jdk</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<modules>
|
||||
<module>property</module>
|
||||
<module>pluginManagement</module>
|
||||
<module>plugin</module>
|
||||
<module>requirement</module>
|
||||
</modules>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
<configuration>
|
||||
<skipDescriptor>true</skipDescriptor>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>@sitePluginVersion@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.4</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>index</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>@project.version@</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>property</artifactId>
|
||||
<name>target bytecode defined by maven.compiler.target property</name>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>1.3</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
|
||||
</properties>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<name>target bytecode defined by maven.compiler.target property</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>property</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>property</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
<?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>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>parent</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>requirement</artifactId>
|
||||
<name>target bytecode defined by report jdk requirement configuration</name>
|
||||
<packaging>maven-plugin</packaging>
|
||||
|
||||
<properties><!-- will be overridden -->
|
||||
<maven.compiler.source>1.3</maven.compiler.source>
|
||||
<maven.compiler.target>${maven.compiler.source}</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration><!-- will be overridden -->
|
||||
<source>1.4</source>
|
||||
<target>1.4</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration><!-- will be overridden -->
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<requirements>
|
||||
<jdk>1.8</jdk>
|
||||
</requirements>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<name>target bytecode defined by report jdk requirement configuration</name>
|
||||
<description></description>
|
||||
<groupId>org.apache.maven.its.plugin-info-jdk</groupId>
|
||||
<artifactId>requirement</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<goalPrefix>requirement</goalPrefix>
|
||||
<isolatedRealm>false</isolatedRealm>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<mojos>
|
||||
<mojo>
|
||||
<goal>touch</goal>
|
||||
<description>Goal which touches a timestamp file.</description>
|
||||
<requiresDirectInvocation>false</requiresDirectInvocation>
|
||||
<requiresProject>true</requiresProject>
|
||||
<requiresReports>false</requiresReports>
|
||||
<aggregator>false</aggregator>
|
||||
<requiresOnline>false</requiresOnline>
|
||||
<inheritedByDefault>true</inheritedByDefault>
|
||||
<phase>process-sources</phase>
|
||||
<implementation>org.apache.maven.plugins.issues.plugin.MyMojo</implementation>
|
||||
<language>java</language>
|
||||
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||
<executionStrategy>once-per-session</executionStrategy>
|
||||
<threadSafe>false</threadSafe>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>outputDirectory</name>
|
||||
<type>java.io.File</type>
|
||||
<required>true</required>
|
||||
<editable>true</editable>
|
||||
<description>Location of the file.</description>
|
||||
</parameter>
|
||||
</parameters>
|
||||
<configuration>
|
||||
<outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</mojo>
|
||||
</mojos>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven</groupId>
|
||||
<artifactId>maven-plugin-api</artifactId>
|
||||
<type>jar</type>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
assert new File( basedir, 'property/target/site/plugin-info.html' ).text.contains( '<td>1.3</td>' )
|
||||
assert new File( basedir, 'pluginManagement/target/site/plugin-info.html' ).text.contains( '<td>1.4</td>' )
|
||||
assert new File( basedir, 'plugin/target/site/plugin-info.html' ).text.contains( '<td>1.5</td>' )
|
||||
assert new File( basedir, 'requirement/target/site/plugin-info.html' ).text.contains( '<td>1.8</td>' )
|
||||
|
||||
return true;
|
||||
|
|
@ -62,6 +62,16 @@ under the License.
|
|||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
<configuration>
|
||||
<!-- old maven-parent, so fix it like this. -->
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
# 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 = install -DskipTests
|
||||
# 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 = install -DskipTests
|
||||
invoker.mavenOpts = -Dmaven.plugin.skip=true
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert !descriptorFile.isFile()
|
||||
|
||||
return true;
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
File descriptorFile = new File( basedir, "target/classes/META-INF/maven/plugin.xml" );
|
||||
assert !descriptorFile.isFile()
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,93 @@
|
|||
<?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.
|
||||
-->
|
||||
|
||||
<component-set>
|
||||
<components>
|
||||
<!--
|
||||
| MAVEN PLUGIN
|
||||
|-->
|
||||
<component>
|
||||
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
|
||||
<role-hint>maven-plugin</role-hint>
|
||||
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
|
||||
<configuration>
|
||||
<type>maven-plugin</type>
|
||||
<extension>jar</extension>
|
||||
<language>java</language>
|
||||
<addedToClasspath>true</addedToClasspath>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
<!--
|
||||
| Defining the phases with their appropriate plugins
|
||||
! and versions which will be executed during the 'default'
|
||||
! life cycle.
|
||||
-->
|
||||
<!--
|
||||
| MAVEN PLUGIN
|
||||
|-->
|
||||
<component>
|
||||
<role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
|
||||
<role-hint>maven-plugin</role-hint>
|
||||
<implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
|
||||
<configuration>
|
||||
<lifecycles>
|
||||
<lifecycle>
|
||||
<id>default</id>
|
||||
<!-- START SNIPPET: maven-plugin-lifecycle -->
|
||||
<phases>
|
||||
<process-resources>
|
||||
org.apache.maven.plugins:maven-resources-plugin:3.0.1:resources
|
||||
</process-resources>
|
||||
<compile>
|
||||
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile
|
||||
</compile>
|
||||
<process-classes>
|
||||
org.apache.maven.plugins:maven-plugin-plugin:${project.version}:descriptor
|
||||
</process-classes>
|
||||
<process-test-resources>
|
||||
org.apache.maven.plugins:maven-resources-plugin:3.0.1:testResources
|
||||
</process-test-resources>
|
||||
<test-compile>
|
||||
org.apache.maven.plugins:maven-compiler-plugin:3.5.1:testCompile
|
||||
</test-compile>
|
||||
<test>
|
||||
org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test
|
||||
</test>
|
||||
<package>
|
||||
org.apache.maven.plugins:maven-jar-plugin:3.0.2:jar,
|
||||
org.apache.maven.plugins:maven-plugin-plugin:${project.version}:addPluginArtifactMetadata
|
||||
</package>
|
||||
<install>
|
||||
org.apache.maven.plugins:maven-install-plugin:2.5.2:install
|
||||
</install>
|
||||
<deploy>
|
||||
org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy
|
||||
</deploy>
|
||||
</phases>
|
||||
<!-- END SNIPPET: maven-plugin-lifecycle -->
|
||||
</lifecycle>
|
||||
</lifecycles>
|
||||
</configuration>
|
||||
</component>
|
||||
|
||||
</components>
|
||||
</component-set>
|
||||
|
|
@ -21,6 +21,8 @@ package org.apache.maven.plugin.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||
import org.apache.maven.artifact.resolver.filter.IncludesArtifactFilter;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||
|
|
@ -35,10 +37,12 @@ import org.apache.maven.tools.plugin.generator.Generator;
|
|||
import org.apache.maven.tools.plugin.generator.GeneratorException;
|
||||
import org.apache.maven.tools.plugin.generator.GeneratorUtils;
|
||||
import org.apache.maven.tools.plugin.scanner.MojoScanner;
|
||||
import org.codehaus.plexus.component.repository.ComponentDependency;
|
||||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -54,7 +58,7 @@ public abstract class AbstractGeneratorMojo
|
|||
/**
|
||||
* The project currently being built.
|
||||
*/
|
||||
@Component
|
||||
@Parameter( defaultValue = "${project}", readonly = true )
|
||||
protected MavenProject project;
|
||||
|
||||
/**
|
||||
|
|
@ -128,6 +132,16 @@ public abstract class AbstractGeneratorMojo
|
|||
*/
|
||||
@Parameter( defaultValue = "${project.artifacts}", required = true, readonly = true )
|
||||
protected Set<Artifact> dependencies;
|
||||
|
||||
/**
|
||||
* Specify the dependencies as {@code groupId:artifactId} containing (abstract) Mojos.
|
||||
* If not specified in the configuration, this is {@code null} and all dependencies are scanned.
|
||||
* If specified with no children, no dependencies are scanned.
|
||||
*
|
||||
* @since 3.5
|
||||
*/
|
||||
@Parameter
|
||||
private List<String> mojoDependencies;
|
||||
|
||||
/**
|
||||
* List of Remote Repositories used by the resolver
|
||||
|
|
@ -222,21 +236,47 @@ public abstract class AbstractGeneratorMojo
|
|||
if ( encoding == null || encoding.length() < 1 )
|
||||
{
|
||||
getLog().warn( "Using platform encoding (" + ReaderFactory.FILE_ENCODING
|
||||
+ " actually) to read mojo metadata, i.e. build is platform dependent!" );
|
||||
+ " actually) to read mojo source files, i.e. build is platform dependent!" );
|
||||
}
|
||||
else
|
||||
{
|
||||
getLog().info( "Using '" + encoding + "' encoding to read mojo metadata." );
|
||||
getLog().info( "Using '" + encoding + "' encoding to read mojo source files." );
|
||||
}
|
||||
|
||||
Set<Artifact> requestDependencies;
|
||||
if ( mojoDependencies == null )
|
||||
{
|
||||
requestDependencies = dependencies;
|
||||
}
|
||||
else if ( mojoDependencies == null )
|
||||
{
|
||||
requestDependencies = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
requestDependencies = new LinkedHashSet<Artifact>();
|
||||
|
||||
ArtifactFilter filter = new IncludesArtifactFilter( mojoDependencies );
|
||||
|
||||
for ( Artifact artifact : dependencies )
|
||||
{
|
||||
if ( filter.include( artifact ) )
|
||||
{
|
||||
requestDependencies.add( artifact );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
pluginDescriptor.setDependencies( GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() ) );
|
||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||
pluginDescriptor.setDependencies( deps );
|
||||
|
||||
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
|
||||
request.setEncoding( encoding );
|
||||
request.setSkipErrorNoDescriptorsFound( skipErrorNoDescriptorsFound );
|
||||
request.setDependencies( dependencies );
|
||||
request.setDependencies( requestDependencies );
|
||||
request.setLocal( this.local );
|
||||
request.setRemoteRepos( this.remoteRepos );
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ import org.codehaus.plexus.velocity.VelocityComponent;
|
|||
* @version $Id$
|
||||
* @since 2.4
|
||||
*/
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
@Mojo( name = "helpmojo", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true,
|
||||
requiresDependencyResolution = ResolutionScope.COMPILE )
|
||||
public class HelpGeneratorMojo
|
||||
extends AbstractGeneratorMojo
|
||||
{
|
||||
|
|
@ -85,6 +86,9 @@ public class HelpGeneratorMojo
|
|||
public void execute()
|
||||
throws MojoExecutionException
|
||||
{
|
||||
// force value for this plugin
|
||||
skipErrorNoDescriptorsFound = true;
|
||||
|
||||
super.execute();
|
||||
|
||||
if ( !project.getCompileSourceRoots().contains( outputDirectory.getAbsolutePath() ) && !skip )
|
||||
|
|
|
|||
|
|
@ -19,20 +19,35 @@ package org.apache.maven.plugin.plugin;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
|
||||
import org.apache.maven.artifact.versioning.VersionRange;
|
||||
import org.apache.maven.doxia.sink.Sink;
|
||||
import org.apache.maven.doxia.siterenderer.Renderer;
|
||||
import org.apache.maven.execution.RuntimeInformation;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.ReportPlugin;
|
||||
import org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.plugins.plugin.descriptor.MNG6109PluginDescriptorBuilder;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.reporting.AbstractMavenReport;
|
||||
import org.apache.maven.reporting.AbstractMavenReportRenderer;
|
||||
|
|
@ -45,20 +60,14 @@ import org.apache.maven.tools.plugin.generator.GeneratorUtils;
|
|||
import org.apache.maven.tools.plugin.generator.PluginXdocGenerator;
|
||||
import org.apache.maven.tools.plugin.scanner.MojoScanner;
|
||||
import org.apache.maven.tools.plugin.util.PluginUtils;
|
||||
import org.codehaus.plexus.component.repository.ComponentDependency;
|
||||
import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.xml.Xpp3Dom;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Generates the Plugin's documentation report.
|
||||
* Generates the Plugin's documentation report: <code>plugin-info.html</code> plugin overview page,
|
||||
* and one <code><i>goal</i>-mojo.html</code> per goal.
|
||||
*
|
||||
* @author <a href="snicoll@apache.org">Stephane Nicoll</a>
|
||||
* @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
|
||||
|
|
@ -71,7 +80,7 @@ public class PluginReport
|
|||
extends AbstractMavenReport
|
||||
{
|
||||
/**
|
||||
* Report output directory for mojo pages.
|
||||
* Report output directory for mojos' documentation.
|
||||
*/
|
||||
@Parameter( defaultValue = "${project.build.directory}/generated-site/xdoc" )
|
||||
private File outputDirectory;
|
||||
|
|
@ -85,7 +94,7 @@ public class PluginReport
|
|||
/**
|
||||
* The Maven Project.
|
||||
*/
|
||||
@Component
|
||||
@Parameter( defaultValue = "${project}", readonly = true )
|
||||
private MavenProject project;
|
||||
|
||||
/**
|
||||
|
|
@ -181,6 +190,12 @@ public class PluginReport
|
|||
*/
|
||||
@Parameter( defaultValue = "${localRepository}", required = true, readonly = true )
|
||||
protected ArtifactRepository local;
|
||||
|
||||
/**
|
||||
* @since 3.5.1
|
||||
*/
|
||||
@Component
|
||||
private RuntimeInformation rtInfo;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
|
@ -218,7 +233,6 @@ public class PluginReport
|
|||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@SuppressWarnings( "unchecked" )
|
||||
protected void executeReport( Locale locale )
|
||||
throws MavenReportException
|
||||
{
|
||||
|
|
@ -232,6 +246,36 @@ public class PluginReport
|
|||
return;
|
||||
}
|
||||
|
||||
PluginDescriptor pluginDescriptor = extractPluginDescriptor();
|
||||
|
||||
// Generate the mojos' documentation
|
||||
generateMojosDocumentation( pluginDescriptor, locale );
|
||||
|
||||
// Write the overview
|
||||
PluginOverviewRenderer r =
|
||||
new PluginOverviewRenderer( project, requirements, getSink(), pluginDescriptor, locale );
|
||||
r.render();
|
||||
}
|
||||
|
||||
private PluginDescriptor extractPluginDescriptor()
|
||||
throws MavenReportException
|
||||
{
|
||||
PluginDescriptorBuilder builder = getPluginDescriptorBuilder();
|
||||
|
||||
try
|
||||
{
|
||||
return builder.build( new FileReader( new File( project.getBuild().getOutputDirectory(),
|
||||
"META-INF/maven/plugin.xml" ) ) );
|
||||
}
|
||||
catch ( FileNotFoundException e )
|
||||
{
|
||||
getLog().debug( "Failed to read META-INF/maven/plugin.xml, fall back to mojoScanner" );
|
||||
}
|
||||
catch ( PlexusConfigurationException e )
|
||||
{
|
||||
getLog().debug( "Failed to read META-INF/maven/plugin.xml, fall back to mojoScanner" );
|
||||
}
|
||||
|
||||
// Copy from AbstractGeneratorMojo#execute()
|
||||
String defaultGoalPrefix = PluginDescriptor.getGoalPrefixFromArtifactId( project.getArtifactId() );
|
||||
if ( goalPrefix == null )
|
||||
|
|
@ -257,7 +301,9 @@ public class PluginReport
|
|||
|
||||
try
|
||||
{
|
||||
pluginDescriptor.setDependencies( GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() ) );
|
||||
@SuppressWarnings( "unchecked" )
|
||||
List<ComponentDependency> deps = GeneratorUtils.toComponentDependencies( project.getRuntimeDependencies() );
|
||||
pluginDescriptor.setDependencies( deps );
|
||||
|
||||
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
|
||||
request.setEncoding( encoding );
|
||||
|
|
@ -266,7 +312,6 @@ public class PluginReport
|
|||
request.setLocal( this.local );
|
||||
request.setRemoteRepos( this.remoteRepos );
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
mojoScanner.populatePluginDescriptor( request );
|
||||
|
|
@ -275,23 +320,46 @@ public class PluginReport
|
|||
{
|
||||
// this is OK, it happens to lifecycle plugins. Allow generation to proceed.
|
||||
getLog().debug( "Plugin without mojos.", e );
|
||||
|
||||
}
|
||||
|
||||
// Generate the plugin's documentation
|
||||
generatePluginDocumentation( pluginDescriptor, locale );
|
||||
|
||||
// Write the overview
|
||||
PluginOverviewRenderer r =
|
||||
new PluginOverviewRenderer( project, requirements, getSink(), pluginDescriptor, locale );
|
||||
r.render();
|
||||
}
|
||||
|
||||
catch ( ExtractionException e )
|
||||
{
|
||||
throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'",
|
||||
e );
|
||||
}
|
||||
return pluginDescriptor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the pluginDescriptorBuilder to use based on the Maven version: either use the original from the
|
||||
* maven-plugin-api or a patched version for Maven versions before the MNG-6109 fix
|
||||
* (because of Maven MNG-6109 bug that won't give accurate 'since' info when reading plugin.xml).
|
||||
*
|
||||
* @return the proper pluginDescriptorBuilder
|
||||
* @see https://issues.apache.org/jira/browse/MNG-6109
|
||||
* @see https://issues.apache.org/jira/browse/MPLUGIN-319
|
||||
*/
|
||||
private PluginDescriptorBuilder getPluginDescriptorBuilder()
|
||||
{
|
||||
PluginDescriptorBuilder pluginDescriptorBuilder;
|
||||
try
|
||||
{
|
||||
VersionRange versionRange = VersionRange.createFromVersionSpec( "(3.3.9,)" );
|
||||
if ( versionRange.containsVersion( rtInfo.getApplicationVersion() ) )
|
||||
{
|
||||
pluginDescriptorBuilder = new PluginDescriptorBuilder();
|
||||
}
|
||||
else
|
||||
{
|
||||
pluginDescriptorBuilder = new MNG6109PluginDescriptorBuilder();
|
||||
}
|
||||
}
|
||||
catch ( InvalidVersionSpecificationException e )
|
||||
{
|
||||
return new MNG6109PluginDescriptorBuilder();
|
||||
}
|
||||
|
||||
return pluginDescriptorBuilder;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -319,11 +387,13 @@ public class PluginReport
|
|||
}
|
||||
|
||||
/**
|
||||
* Generate the mojos documentation, as xdoc files.
|
||||
*
|
||||
* @param pluginDescriptor not null
|
||||
* @param locale not null
|
||||
* @throws MavenReportException if any
|
||||
*/
|
||||
private void generatePluginDocumentation( PluginDescriptor pluginDescriptor, Locale locale )
|
||||
private void generateMojosDocumentation( PluginDescriptor pluginDescriptor, Locale locale )
|
||||
throws MavenReportException
|
||||
{
|
||||
try
|
||||
|
|
@ -653,10 +723,13 @@ public class PluginReport
|
|||
}
|
||||
|
||||
/**
|
||||
* Try to lookup on the <code>org.apache.maven.plugins:maven-compiler-plugin</code> plugin to
|
||||
* find the value of the <code>target</code> option.
|
||||
* If not specified, uses the value defined by the user.
|
||||
* If not specified, uses the value of the system property <code>java.specification.version</code>.
|
||||
* <ol>
|
||||
* <li>use configured jdk requirement</li>
|
||||
* <li>use <code>target</code> configuration of <code>org.apache.maven.plugins:maven-compiler-plugin</code></li>
|
||||
* <li>use <code>target</code> configuration of <code>org.apache.maven.plugins:maven-compiler-plugin</code> in
|
||||
* <code>pluginManagement</code></li>
|
||||
* <li>use <code>maven.compiler.target</code> property</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param project not null
|
||||
* @param requirements not null
|
||||
|
|
@ -665,84 +738,67 @@ public class PluginReport
|
|||
private static String discoverJdkRequirement( MavenProject project, Requirements requirements )
|
||||
{
|
||||
String jdk = requirements.getJdk();
|
||||
if ( jdk == null )
|
||||
{
|
||||
jdk = discoverJdkRequirementFromPlugins( project.getBuild().getPluginsAsMap() );
|
||||
}
|
||||
if ( jdk == null && project.getPluginManagement() != null )
|
||||
{
|
||||
jdk = discoverJdkRequirementFromPlugins( project.getPluginManagement().getPluginsAsMap() );
|
||||
}
|
||||
if ( jdk == null )
|
||||
{
|
||||
jdk = "Unknown";
|
||||
}
|
||||
|
||||
return jdk;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param pluginsAsMap could be null
|
||||
* @return the value of the <code>target</code> in the configuration of <code>maven-compiler-plugin</code>.
|
||||
*/
|
||||
@SuppressWarnings( "rawtypes" )
|
||||
private static String discoverJdkRequirementFromPlugins( Map pluginsAsMap )
|
||||
{
|
||||
if ( pluginsAsMap == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
String jdk = null;
|
||||
String backupJdk = null;
|
||||
for ( Iterator it = pluginsAsMap.keySet().iterator(); it.hasNext(); )
|
||||
{
|
||||
String key = it.next().toString();
|
||||
|
||||
if ( !key.equals( "org.apache.maven.plugins:maven-compiler-plugin" ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Object value = pluginsAsMap.get( key );
|
||||
Xpp3Dom pluginConf = null;
|
||||
|
||||
backupJdk = "Default version for maven-compiler-plugin";
|
||||
if ( value instanceof Plugin )
|
||||
{
|
||||
Plugin plugin = (Plugin) value;
|
||||
backupJdk = "Default target for maven-compiler-plugin version " + plugin.getVersion();
|
||||
pluginConf = (Xpp3Dom) plugin.getConfiguration();
|
||||
}
|
||||
|
||||
if ( value instanceof ReportPlugin )
|
||||
{
|
||||
ReportPlugin reportPlugin = (ReportPlugin) value;
|
||||
backupJdk = "Default target for maven-compiler-plugin version " + reportPlugin.getVersion();
|
||||
pluginConf = (Xpp3Dom) reportPlugin.getConfiguration();
|
||||
}
|
||||
|
||||
if ( pluginConf == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( pluginConf.getChild( "target" ) == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
jdk = pluginConf.getChild( "target" ).getValue();
|
||||
}
|
||||
|
||||
if ( jdk == null )
|
||||
{
|
||||
return backupJdk;
|
||||
}
|
||||
else
|
||||
if ( jdk != null )
|
||||
{
|
||||
return jdk;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
Plugin compiler = getCompilerPlugin( project.getBuild().getPluginsAsMap() );
|
||||
if ( compiler == null )
|
||||
{
|
||||
compiler = getCompilerPlugin( project.getPluginManagement().getPluginsAsMap() );
|
||||
}
|
||||
|
||||
jdk = getPluginParameter( compiler, "target" );
|
||||
if ( jdk != null )
|
||||
{
|
||||
return jdk;
|
||||
}
|
||||
|
||||
// default value
|
||||
jdk = project.getProperties().getProperty( "maven.compiler.target" );
|
||||
if ( jdk != null )
|
||||
{
|
||||
return jdk;
|
||||
}
|
||||
|
||||
// return "1.5" by default?
|
||||
|
||||
String version = ( compiler == null ) ? null : compiler.getVersion();
|
||||
|
||||
if ( version != null )
|
||||
{
|
||||
return "Default target for maven-compiler-plugin version " + version;
|
||||
}
|
||||
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
private static Plugin getCompilerPlugin( Map<String, Object> pluginsAsMap )
|
||||
{
|
||||
return (Plugin) pluginsAsMap.get( "org.apache.maven.plugins:maven-compiler-plugin" );
|
||||
}
|
||||
|
||||
private static String getPluginParameter( Plugin plugin, String parameter )
|
||||
{
|
||||
if ( plugin != null )
|
||||
{
|
||||
Xpp3Dom pluginConf = (Xpp3Dom) plugin.getConfiguration();
|
||||
|
||||
if ( pluginConf != null )
|
||||
{
|
||||
Xpp3Dom target = pluginConf.getChild( parameter );
|
||||
|
||||
if ( target != null )
|
||||
{
|
||||
return target.getValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import org.apache.maven.artifact.repository.metadata.Versioning;
|
|||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
|
|
@ -38,7 +37,8 @@ import org.apache.maven.project.MavenProject;
|
|||
* artifact, for subsequent installation and deployment.
|
||||
* It is used:
|
||||
* <ol>
|
||||
* <li>to add the <code>latest</code> metadata (which is plugin-specific) for shipping alongside the plugin's artifact</li>
|
||||
* <li>to add the <code>latest</code> metadata (which is plugin-specific) for shipping alongside the plugin's
|
||||
* artifact</li>
|
||||
* <li>to define plugin mapping in the group</li>
|
||||
* </ol>
|
||||
*
|
||||
|
|
@ -54,7 +54,7 @@ public class AddPluginArtifactMetadataMojo
|
|||
/**
|
||||
* The project artifact, which should have the <code>latest</code> metadata added to it.
|
||||
*/
|
||||
@Component
|
||||
@Parameter( defaultValue = "${project}", readonly = true )
|
||||
private MavenProject project;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
package org.apache.maven.plugins.plugin.descriptor;
|
||||
|
||||
/*
|
||||
* 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.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.Parameter;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
|
||||
import org.codehaus.plexus.configuration.PlexusConfiguration;
|
||||
import org.codehaus.plexus.configuration.PlexusConfigurationException;
|
||||
|
||||
/**
|
||||
* Reads the plugin descriptor and adds the fix for MNG-6109 when using Maven-3.3.9 and before.
|
||||
* Class can be removed once Maven 3.5.0 is the prerequisite for this plugin.
|
||||
*
|
||||
* @author Robert Scholte
|
||||
* @since 3.5.1
|
||||
*/
|
||||
public class MNG6109PluginDescriptorBuilder extends PluginDescriptorBuilder
|
||||
{
|
||||
|
||||
@Override
|
||||
public MojoDescriptor buildComponentDescriptor( PlexusConfiguration c, PluginDescriptor pluginDescriptor )
|
||||
throws PlexusConfigurationException
|
||||
{
|
||||
MojoDescriptor mojoDescriptor = super.buildComponentDescriptor( c, pluginDescriptor );
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Parameters
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
PlexusConfiguration[] parameterConfigurations = c.getChild( "parameters" ).getChildren( "parameter" );
|
||||
|
||||
for ( PlexusConfiguration d : parameterConfigurations )
|
||||
{
|
||||
String parameterName = d.getChild( "name" ).getValue();
|
||||
Parameter pd = (Parameter) mojoDescriptor.getParameterMap().get( parameterName );
|
||||
|
||||
String parameterSince = d.getChild( "since" ).getValue();
|
||||
pd.setSince( parameterSince );
|
||||
}
|
||||
|
||||
return mojoDescriptor;
|
||||
}
|
||||
}
|
||||
|
|
@ -24,16 +24,18 @@
|
|||
~~ under the License.
|
||||
|
||||
~~ NOTE: For help with the syntax of this file, see:
|
||||
~~ http://maven.apache.org/doxia/references/apt-format.html
|
||||
~~ https://maven.apache.org/doxia/references/apt-format.html
|
||||
|
||||
Using Plugin Tools Java5 Annotations
|
||||
|
||||
Since version 3.0, you can use Java5 annotations to generate the plugin descriptor file.
|
||||
Since version 3.0 of the maven-plugin-plugin, you can use Java5 annotations to generate the
|
||||
plugin descriptor file.
|
||||
|
||||
<<NOTE>> With annotations, your Mojo super class does not any more require to be in the same project. Provided that the super class also uses annotations, it
|
||||
can now come from reactor projects or external dependencies. As javadoc doclet are still useful for <<<@since>>>, <<<@deprecated>>> and comments,
|
||||
the sources are still scanned. So if you use an external dependency, you must still provide an artifact with sources (<<<sources>>> classifier) to
|
||||
provide documentation (the tooling will skip error if this artifact sources is missing).
|
||||
can now come from reactor projects or external dependencies. By default all dependencies are scanned, but this can be reduced with the <<<mojoDependencies>>>
|
||||
parameter. As javadoc doclet are still useful for <<<@since>>>, <<<@deprecated>>> and comments, the sources are still scanned. So if you use an external
|
||||
dependency, you must still provide an artifact with sources (<<<sources>>> classifier) to provide documentation (the tooling will skip error if this artifact
|
||||
sources is missing).
|
||||
|
||||
* Annotations
|
||||
|
||||
|
|
@ -77,10 +79,7 @@ Using Plugin Tools Java5 Annotations
|
|||
|
||||
* add <<<maven-plugin-annotations>>> dependency, preferably with <<<provided>>> scope,
|
||||
|
||||
* bind goals to <<<process-classes>>> phase,
|
||||
|
||||
* configure <<<skipErrorNoDescriptorsFound>>> parameter to avoid failure caused by
|
||||
{{{http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_maven-plugin_packaging}default <<<descriptor>>> goal binding to <<<generate-resources>>> phase}}.
|
||||
* override Maven core's <<<default-descriptor>>> execution phase to <<<process-classes>>>,
|
||||
|
||||
[]
|
||||
|
||||
|
|
@ -95,7 +94,7 @@ Using Plugin Tools Java5 Annotations
|
|||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-annotations</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope><!-- annotations are needed only to build the plugin -->
|
||||
<optional>true</optional> <!-- annotations are not used at runtime because @Retention(value=CLASS), they are needed only to build the plugin -->
|
||||
</dependency>
|
||||
</dependencies>
|
||||
...
|
||||
|
|
@ -105,16 +104,10 @@ Using Plugin Tools Java5 Annotations
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<configuration>
|
||||
<!-- see http://jira.codehaus.org/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
<id>default-descriptor</id>
|
||||
<phase>process-classes</phase>
|
||||
</execution>
|
||||
<!-- if you want to generate help goal -->
|
||||
<execution>
|
||||
|
|
@ -131,3 +124,44 @@ Using Plugin Tools Java5 Annotations
|
|||
...
|
||||
</project>
|
||||
+-----+
|
||||
|
||||
<Notice>: this configuration will not work with Maven 2, which does not support execution phase overriding.
|
||||
If you absolutely need to build with Maven 2, you should use <<<skipErrorNoDescriptorsFound>>> parameter
|
||||
to avoid failure on default execution phase and add another execution:
|
||||
|
||||
+-----+
|
||||
<project>
|
||||
...
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>maven-2</id>
|
||||
<activation>
|
||||
<file>
|
||||
<!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
|
||||
<missing>${basedir}</missing>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-plugin-plugin</artifactId>
|
||||
<configuration>
|
||||
<!-- see https://issues.apache.org/jira/browse/MNG-5346 -->
|
||||
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>mojo-descriptor</id>
|
||||
<goals>
|
||||
<goal>descriptor</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
+-----+
|
||||
|
|
|
|||
|
|
@ -39,10 +39,8 @@ Maven Plugin Plugin
|
|||
|
||||
* {{{./descriptor-mojo.html}plugin:descriptor}} generates a plugin descriptor,
|
||||
|
||||
* {{{./report-mojo.html}plugin:report}} generates the plugin documentation report, listing each goal provided
|
||||
and general configuration information (see {{{./plugin-info.html}example}}),
|
||||
|
||||
* {{{./xdoc-mojo.html}plugin:xdoc}} generates documentation (as xdoc files) for each mojo (goals),
|
||||
* {{{./report-mojo.html}plugin:report}} generates the plugin documentation: one overview report
|
||||
(see {{{./plugin-info.html}example}}) and documentation for each plugin's goal (mojo),
|
||||
|
||||
* {{{./updateRegistry-mojo.html}plugin:updateRegistry}} updates the user plugin registry (if it's in use) to
|
||||
reflect the version being installed,
|
||||
|
|
|
|||
|
|
@ -54,15 +54,18 @@ mvn package
|
|||
mvn plugin:descriptor
|
||||
+-----+
|
||||
|
||||
* The <<<plugin:xdoc>>> Goal
|
||||
* The <<<plugin:report>>> Goal
|
||||
|
||||
To generate Xdoc files for the mojos of your plugin, execute the following on the command line:
|
||||
To generate the documentation of your plugin, execute the following on the command line:
|
||||
|
||||
+-----+
|
||||
mvn plugin:xdoc
|
||||
mvn plugin:report
|
||||
+-----+
|
||||
|
||||
The xdoc file is generated by default in <<<$\{project.build.directory\}/generated-site/xdoc>>>.
|
||||
The xdoc files, one per goal, are generated by default in <<<$\{project.build.directory\}/generated-site/xdoc>>>,
|
||||
and an overview is generated in the site output.
|
||||
|
||||
If you add the plugin to the <<<reporting>>> section of your pom, you'll get the full report as html with <<<mvn site>>>.
|
||||
|
||||
* The <<<plugin:updateRegistry>>> Goal
|
||||
|
||||
|
|
|
|||
|
|
@ -29,13 +29,13 @@ under the License.
|
|||
<href>http://maven.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<src>http://maven.apache.org/images/maventxt_logo_200.gif</src>
|
||||
<src>https://maven.apache.org/images/maven-logo-black-on-white.png</src>
|
||||
</bannerRight>
|
||||
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<version>1.5</version>
|
||||
</skin>
|
||||
|
||||
<custom>
|
||||
|
|
@ -53,6 +53,9 @@ under the License.
|
|||
<item name="Usage" href="usage.html"/>
|
||||
<item name="FAQ" href="faq.html"/>
|
||||
<item name="Release Notes" href="jira-report.html"/>
|
||||
<!-- According to https://issues.apache.org/jira/browse/MNGSITE-152 -->
|
||||
<item name="License" href="http://www.apache.org/licenses/"/>
|
||||
<item name="Download" href="../download.html"/>
|
||||
</menu>
|
||||
|
||||
<menu name="Examples">
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.3</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-annotations</artifactId>
|
||||
|
|
@ -70,10 +70,6 @@
|
|||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-container-default</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ow2.asm</groupId>
|
||||
<artifactId>asm</artifactId>
|
||||
|
|
@ -101,6 +97,10 @@
|
|||
</exclusions>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -19,10 +19,22 @@ package org.apache.maven.tools.plugin.annotations;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import com.thoughtworks.qdox.JavaDocBuilder;
|
||||
import com.thoughtworks.qdox.model.DocletTag;
|
||||
import com.thoughtworks.qdox.model.JavaClass;
|
||||
import com.thoughtworks.qdox.model.JavaField;
|
||||
import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.factory.ArtifactFactory;
|
||||
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
|
||||
|
|
@ -37,15 +49,15 @@ import org.apache.maven.plugin.descriptor.Requirement;
|
|||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.tools.plugin.ExtendedMojoDescriptor;
|
||||
import org.apache.maven.tools.plugin.PluginToolsRequest;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScannerRequest;
|
||||
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||
import org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScannerRequest;
|
||||
import org.apache.maven.tools.plugin.util.PluginUtils;
|
||||
import org.codehaus.plexus.archiver.UnArchiver;
|
||||
import org.codehaus.plexus.archiver.manager.ArchiverManager;
|
||||
|
|
@ -54,18 +66,11 @@ import org.codehaus.plexus.component.annotations.Component;
|
|||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.TreeSet;
|
||||
import com.thoughtworks.qdox.JavaProjectBuilder;
|
||||
import com.thoughtworks.qdox.library.SortedClassLibraryBuilder;
|
||||
import com.thoughtworks.qdox.model.DocletTag;
|
||||
import com.thoughtworks.qdox.model.JavaClass;
|
||||
import com.thoughtworks.qdox.model.JavaField;
|
||||
|
||||
/**
|
||||
* JavaMojoDescriptorExtractor, a MojoDescriptor extractor to read descriptors from java classes with annotations.
|
||||
|
|
@ -219,7 +224,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
unArchiver.setDestDirectory( extractDirectory );
|
||||
unArchiver.extract();
|
||||
|
||||
return discoverClasses( request.getEncoding(), Arrays.asList( extractDirectory ) );
|
||||
return discoverClasses( request.getEncoding(), Arrays.asList( extractDirectory ),
|
||||
request.getDependencies() );
|
||||
}
|
||||
catch ( ArtifactResolutionException e )
|
||||
{
|
||||
|
|
@ -283,8 +289,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
Map<String, ParameterAnnotationContent> parameters =
|
||||
getParametersParentHierarchy( entry.getValue(), new HashMap<String, ParameterAnnotationContent>(),
|
||||
mojoAnnotatedClasses );
|
||||
for ( Map.Entry<String, ParameterAnnotationContent> parameter : new TreeMap<String, ParameterAnnotationContent>(
|
||||
parameters ).entrySet() )
|
||||
parameters = new TreeMap<String, ParameterAnnotationContent>( parameters );
|
||||
for ( Map.Entry<String, ParameterAnnotationContent> parameter : parameters.entrySet() )
|
||||
{
|
||||
JavaField javaField = fieldsMap.get( parameter.getKey() );
|
||||
if ( javaField == null )
|
||||
|
|
@ -309,7 +315,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
// populate components
|
||||
for ( Map.Entry<String, ComponentAnnotationContent> component : entry.getValue().getComponents().entrySet() )
|
||||
Map<String, ComponentAnnotationContent> components = entry.getValue().getComponents();
|
||||
for ( Map.Entry<String, ComponentAnnotationContent> component : components.entrySet() )
|
||||
{
|
||||
JavaField javaField = fieldsMap.get( component.getKey() );
|
||||
if ( javaField == null )
|
||||
|
|
@ -376,7 +383,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
|
||||
if ( superClass != null )
|
||||
{
|
||||
if ( superClass.getFields().length > 0 )
|
||||
if ( superClass.getFields().size() > 0 )
|
||||
{
|
||||
rawParams = extractFieldParameterTags( superClass, javaClassesMap );
|
||||
}
|
||||
|
|
@ -393,15 +400,11 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
rawParams = new TreeMap<String, JavaField>();
|
||||
}
|
||||
|
||||
JavaField[] classFields = javaClass.getFields();
|
||||
|
||||
if ( classFields != null )
|
||||
for ( JavaField field : javaClass.getFields() )
|
||||
{
|
||||
for ( JavaField field : classFields )
|
||||
{
|
||||
rawParams.put( field.getName(), field );
|
||||
}
|
||||
rawParams.put( field.getName(), field );
|
||||
}
|
||||
|
||||
return rawParams;
|
||||
}
|
||||
|
||||
|
|
@ -428,27 +431,43 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
sources.add( generatedPlugin );
|
||||
}
|
||||
|
||||
return discoverClasses( encoding, sources );
|
||||
return discoverClasses( encoding, sources, project.getArtifacts() );
|
||||
}
|
||||
|
||||
protected Map<String, JavaClass> discoverClasses( final String encoding, List<File> sourceDirectories )
|
||||
protected Map<String, JavaClass> discoverClasses( final String encoding, List<File> sourceDirectories,
|
||||
Set<Artifact> artifacts )
|
||||
{
|
||||
JavaDocBuilder builder = new JavaDocBuilder();
|
||||
JavaProjectBuilder builder = new JavaProjectBuilder( new SortedClassLibraryBuilder() );
|
||||
builder.setEncoding( encoding );
|
||||
|
||||
// Build isolated Classloader with only the artifacts of the project (none of this plugin)
|
||||
List<URL> urls = new ArrayList<URL>( artifacts.size() );
|
||||
for ( Artifact artifact : artifacts )
|
||||
{
|
||||
try
|
||||
{
|
||||
urls.add( artifact.getFile().toURI().toURL() );
|
||||
}
|
||||
catch ( MalformedURLException e )
|
||||
{
|
||||
// noop
|
||||
}
|
||||
}
|
||||
builder.addClassLoader( new URLClassLoader( urls.toArray( new URL[0] ), ClassLoader.getSystemClassLoader() ) );
|
||||
|
||||
for ( File source : sourceDirectories )
|
||||
{
|
||||
builder.addSourceTree( source );
|
||||
}
|
||||
|
||||
JavaClass[] javaClasses = builder.getClasses();
|
||||
Collection<JavaClass> javaClasses = builder.getClasses();
|
||||
|
||||
if ( javaClasses == null || javaClasses.length < 1 )
|
||||
if ( javaClasses == null || javaClasses.size() < 1 )
|
||||
{
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
Map<String, JavaClass> javaClassMap = new HashMap<String, JavaClass>( javaClasses.length );
|
||||
Map<String, JavaClass> javaClassMap = new HashMap<String, JavaClass>( javaClasses.size() );
|
||||
|
||||
for ( JavaClass javaClass : javaClasses )
|
||||
{
|
||||
|
|
@ -580,9 +599,10 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
else
|
||||
{
|
||||
// not a component but a Maven object to be transformed into an expression/property: deprecated
|
||||
getLogger().warn( "Deprecated @component for " + parameter.getName() + " field in "
|
||||
+ mojoAnnotatedClass.getClassName() + "."
|
||||
+ ": replace with @parameter name=\"" + expression + "\" @readonly" );
|
||||
getLogger().warn( "Deprecated @Component annotation for '" + parameter.getName() + "' field in "
|
||||
+ mojoAnnotatedClass.getClassName()
|
||||
+ ": replace with @Parameter( defaultValue = \"" + expression
|
||||
+ "\", readonly = true )" );
|
||||
parameter.setDefaultValue( expression );
|
||||
parameter.setType( componentAnnotationContent.getRoleClassName() );
|
||||
parameter.setRequired( true );
|
||||
|
|
@ -605,7 +625,7 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected ExecuteAnnotationContent findExecuteInParentHierarchy( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
if ( mojoAnnotatedClass.getExecute() != null )
|
||||
{
|
||||
|
|
@ -648,8 +668,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected List<ParameterAnnotationContent> getParametersParent( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
List<ParameterAnnotationContent> parameterAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
List<ParameterAnnotationContent> parameterAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
parameterAnnotationContents.addAll( mojoAnnotatedClass.getParameters().values() );
|
||||
String parentClassName = mojoAnnotatedClass.getParentClassName();
|
||||
|
|
@ -687,8 +707,8 @@ public class JavaAnnotationsMojoDescriptorExtractor
|
|||
}
|
||||
|
||||
protected List<ComponentAnnotationContent> getComponentParent( MojoAnnotatedClass mojoAnnotatedClass,
|
||||
List<ComponentAnnotationContent> componentAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
List<ComponentAnnotationContent> componentAnnotationContents,
|
||||
Map<String, MojoAnnotatedClass> mojoAnnotatedClasses )
|
||||
{
|
||||
componentAnnotationContents.addAll( mojoAnnotatedClass.getComponents().values() );
|
||||
String parentClassName = mojoAnnotatedClass.getParentClassName();
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.datamodel;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.datamodel;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -20,7 +20,6 @@ package org.apache.maven.tools.plugin.annotations.datamodel;
|
|||
*/
|
||||
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -19,28 +19,6 @@ package org.apache.maven.tools.plugin.annotations.scanner;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.visitors.MojoAnnotationVisitor;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.visitors.MojoClassVisitor;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.visitors.MojoFieldVisitor;
|
||||
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.codehaus.plexus.util.DirectoryScanner;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.reflection.Reflector;
|
||||
import org.codehaus.plexus.util.reflection.ReflectorException;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
|
@ -49,9 +27,32 @@ import java.io.InputStream;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Execute;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.tools.plugin.extractor.ExtractionException;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.MojoAnnotationVisitor;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.MojoClassVisitor;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors.MojoFieldVisitor;
|
||||
import org.codehaus.plexus.logging.AbstractLogEnabled;
|
||||
import org.codehaus.plexus.util.DirectoryScanner;
|
||||
import org.codehaus.plexus.util.IOUtil;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.codehaus.plexus.util.reflection.Reflector;
|
||||
import org.codehaus.plexus.util.reflection.ReflectorException;
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.Type;
|
||||
|
||||
/**
|
||||
* @author Olivier Lamy
|
||||
* @since 3.0
|
||||
|
|
@ -61,6 +62,9 @@ public class DefaultMojoAnnotationsScanner
|
|||
extends AbstractLogEnabled
|
||||
implements MojoAnnotationsScanner
|
||||
{
|
||||
// classes with a dash must be ignored
|
||||
private static final Pattern SCANNABLE_CLASS = Pattern.compile( "[^-]+\\.class" );
|
||||
|
||||
private Reflector reflector = new Reflector();
|
||||
|
||||
public Map<String, MojoAnnotatedClass> scan( MojoAnnotationsScannerRequest request )
|
||||
|
|
@ -115,7 +119,7 @@ public class DefaultMojoAnnotationsScanner
|
|||
* @param archiveFile
|
||||
* @param artifact
|
||||
* @param excludeMojo for dependencies, we exclude Mojo annotations found
|
||||
* @return
|
||||
* @return annotated classes found
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
*/
|
||||
|
|
@ -126,19 +130,28 @@ public class DefaultMojoAnnotationsScanner
|
|||
|
||||
ZipInputStream archiveStream = new ZipInputStream( new FileInputStream( archiveFile ) );
|
||||
|
||||
String zipEntryName = null;
|
||||
try
|
||||
{
|
||||
|
||||
for ( ZipEntry zipEntry = archiveStream.getNextEntry(); zipEntry != null;
|
||||
zipEntry = archiveStream.getNextEntry() )
|
||||
{
|
||||
if ( !zipEntry.getName().endsWith( ".class" ) )
|
||||
zipEntryName = zipEntry.getName();
|
||||
if ( !SCANNABLE_CLASS.matcher( zipEntryName ).matches() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
analyzeClassStream( mojoAnnotatedClasses, archiveStream, artifact, excludeMojo );
|
||||
}
|
||||
}
|
||||
catch ( IllegalArgumentException e )
|
||||
{
|
||||
// In case of a class with newer specs an IllegalArgumentException can be thrown
|
||||
getLogger().error( "Failed to analyze " + archiveFile.getAbsolutePath() + "!/" + zipEntryName );
|
||||
|
||||
throw e;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtil.close( archiveStream );
|
||||
|
|
@ -152,7 +165,7 @@ public class DefaultMojoAnnotationsScanner
|
|||
* @param includePatterns
|
||||
* @param artifact
|
||||
* @param excludeMojo for dependencies, we exclude Mojo annotations found
|
||||
* @return
|
||||
* @return annotated classes found
|
||||
* @throws IOException
|
||||
* @throws ExtractionException
|
||||
*/
|
||||
|
|
@ -174,7 +187,7 @@ public class DefaultMojoAnnotationsScanner
|
|||
|
||||
for ( String classFile : classFiles )
|
||||
{
|
||||
if ( !classFile.endsWith( ".class" ) )
|
||||
if ( !SCANNABLE_CLASS.matcher( classFile ).matches() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
@ -264,7 +277,8 @@ public class DefaultMojoAnnotationsScanner
|
|||
new ParameterAnnotationContent( mojoFieldVisitor.getFieldName(), mojoFieldVisitor.getClassName() );
|
||||
if ( mojoFieldVisitor.getMojoAnnotationVisitor() != null )
|
||||
{
|
||||
populateAnnotationContent( parameterAnnotationContent, mojoFieldVisitor.getMojoAnnotationVisitor() );
|
||||
populateAnnotationContent( parameterAnnotationContent,
|
||||
mojoFieldVisitor.getMojoAnnotationVisitor() );
|
||||
}
|
||||
|
||||
mojoAnnotatedClass.getParameters().put( parameterAnnotationContent.getFieldName(),
|
||||
|
|
@ -278,9 +292,10 @@ public class DefaultMojoAnnotationsScanner
|
|||
ComponentAnnotationContent componentAnnotationContent =
|
||||
new ComponentAnnotationContent( mojoFieldVisitor.getFieldName() );
|
||||
|
||||
if ( mojoFieldVisitor.getMojoAnnotationVisitor() != null )
|
||||
MojoAnnotationVisitor annotationVisitor = mojoFieldVisitor.getMojoAnnotationVisitor();
|
||||
if ( annotationVisitor != null )
|
||||
{
|
||||
for ( Map.Entry<String, Object> entry : mojoFieldVisitor.getMojoAnnotationVisitor().getAnnotationValues().entrySet() )
|
||||
for ( Map.Entry<String, Object> entry : annotationVisitor.getAnnotationValues().entrySet() )
|
||||
{
|
||||
String methodName = entry.getKey();
|
||||
if ( StringUtils.equals( "role", methodName ) )
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -20,10 +20,10 @@ package org.apache.maven.tools.plugin.annotations.scanner;
|
|||
*/
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ExecuteAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.MojoAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ParameterAnnotationContent;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -37,9 +37,9 @@ public interface MojoAnnotationsScanner
|
|||
{
|
||||
String ROLE = MojoAnnotationsScanner.class.getName();
|
||||
|
||||
final List<String> CLASS_LEVEL_ANNOTATIONS = Arrays.asList( Mojo.class.getName(), Execute.class.getName() );
|
||||
List<String> CLASS_LEVEL_ANNOTATIONS = Arrays.asList( Mojo.class.getName(), Execute.class.getName() );
|
||||
|
||||
final List<String> FIELD_LEVEL_ANNOTATIONS = Arrays.asList( Parameter.class.getName(), Component.class.getName() );
|
||||
List<String> FIELD_LEVEL_ANNOTATIONS = Arrays.asList( Parameter.class.getName(), Component.class.getName() );
|
||||
|
||||
/**
|
||||
* Scan classes for mojo annotations.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner.visitors;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -41,7 +41,7 @@ public class MojoAnnotationVisitor
|
|||
|
||||
MojoAnnotationVisitor( Logger logger, String annotationClassName )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
this.annotationClassName = annotationClassName;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner.visitors;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -19,8 +19,8 @@ package org.apache.maven.tools.plugin.annotations.scanner.visitors;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.codehaus.plexus.util.StringUtils;
|
||||
import org.objectweb.asm.AnnotationVisitor;
|
||||
|
|
@ -53,7 +53,7 @@ public class MojoClassVisitor
|
|||
|
||||
public MojoClassVisitor( Logger logger )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations.scanner.visitors;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations.scanner.visitors;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -19,7 +19,7 @@ package org.apache.maven.tools.plugin.annotations.scanner.visitors;
|
|||
* under the License.
|
||||
*/
|
||||
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
import org.objectweb.asm.AnnotationVisitor;
|
||||
import org.objectweb.asm.Attribute;
|
||||
|
|
@ -44,7 +44,7 @@ public class MojoFieldVisitor
|
|||
|
||||
MojoFieldVisitor( Logger logger, String fieldName, String className )
|
||||
{
|
||||
super( Opcodes.ASM4 );
|
||||
super( Opcodes.ASM5 );
|
||||
this.logger = logger;
|
||||
this.fieldName = fieldName;
|
||||
this.className = className;
|
||||
|
|
@ -28,7 +28,8 @@
|
|||
|
||||
Maven Plugin Tool for Annotations
|
||||
|
||||
The Maven Plugin Tool for Annotations is the implementation of {{{../maven-plugin-tools-api/index.html}maven-plugin-tools-api}}
|
||||
The Maven Plugin Tool for Annotations is the <<<java-annotations>>> implementation of
|
||||
{{{../maven-plugin-tools-api/index.html}maven-plugin-tools-api}}
|
||||
to extract descriptors from plugins written in Java with
|
||||
{{{../maven-plugin-annotations/index.html}Maven Plugin Tools Java 5 Annotations}}.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.apache.maven.tools.plugin.annotations;
|
||||
package org.apache.maven.tools.plugin.extractor.annotations;
|
||||
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
|
|
@ -24,11 +24,11 @@ import org.apache.maven.plugins.annotations.Execute;
|
|||
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||
import org.apache.maven.plugins.annotations.Mojo;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.annotations.scanner.MojoAnnotationsScannerRequest;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ComponentAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.datamodel.ParameterAnnotationContent;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotatedClass;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScanner;
|
||||
import org.apache.maven.tools.plugin.extractor.annotations.scanner.MojoAnnotationsScannerRequest;
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.fest.assertions.Assertions;
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ public class TestAnnotationsReader
|
|||
MojoAnnotationsScanner mojoAnnotationsScanner = (MojoAnnotationsScanner) lookup( MojoAnnotationsScanner.ROLE );
|
||||
|
||||
MojoAnnotationsScannerRequest request = new MojoAnnotationsScannerRequest();
|
||||
request.setClassesDirectories( Collections.singletonList( new File( "target/test-classes" ) ) );
|
||||
request.setClassesDirectories( Collections.singletonList( new File( getBasedir(), "target/test-classes" ) ) );
|
||||
request.setIncludePatterns( Arrays.asList( "**/FooMojo.class" ) );
|
||||
request.setProject( new MavenProject() );
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package org.apache.maven.tools.plugin.extractor.annotations.scanner;
|
||||
|
||||
/*
|
||||
* 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 static org.easymock.EasyMock.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import org.codehaus.plexus.PlexusTestCase;
|
||||
import org.codehaus.plexus.logging.Logger;
|
||||
|
||||
public class DefaultMojoAnnotationsScannerTest
|
||||
extends PlexusTestCase
|
||||
{
|
||||
private DefaultMojoAnnotationsScanner scanner = new DefaultMojoAnnotationsScanner();
|
||||
|
||||
public void testSkipModuleInfoClassInArchive() throws Exception
|
||||
{
|
||||
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java9-module.jar"), null, false );
|
||||
}
|
||||
|
||||
public void testJava8Annotations() throws Exception
|
||||
{
|
||||
Logger logger = createMock( Logger.class );
|
||||
expect( logger.isDebugEnabled() ).andReturn( false );
|
||||
replay( logger );
|
||||
scanner.enableLogging( logger );
|
||||
scanner.scanArchive( new File( getBasedir(), "target/test-classes/java8-annotations.jar"), null, false );
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
|
|
@ -25,13 +25,13 @@
|
|||
<parent>
|
||||
<groupId>org.apache.maven.plugin-tools</groupId>
|
||||
<artifactId>maven-plugin-tools</artifactId>
|
||||
<version>3.3</version>
|
||||
<version>3.5.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>maven-plugin-tools-api</artifactId>
|
||||
|
||||
<name>Maven Plugin Tools APIs</name>
|
||||
<description>The Maven Plugin Tools API provides an API to extract descriptor information from Maven Plugins.</description>
|
||||
<name>Maven Plugin Tools Extractor API</name>
|
||||
<description>The Maven Plugin Tools Extractor API provides an API to extract descriptor information from Maven Plugins.</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- maven -->
|
||||
|
|
@ -61,10 +61,6 @@
|
|||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-utils</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.plexus</groupId>
|
||||
<artifactId>plexus-container-default</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- test -->
|
||||
<dependency>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.apache.maven.tools.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
import org.codehaus.plexus.util.ReaderFactory;
|
||||
|
|
@ -33,7 +32,8 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* Default implementation of {@link PluginToolsRequest}, which is used to pass parameters to components used to extract
|
||||
* {@link MojoDescriptor} instances from different types of metadata for a given plugin.
|
||||
* {@link org.apache.maven.plugin.descriptor.MojoDescriptor MojoDescriptor} instances from different types of metadata
|
||||
* for a given plugin.
|
||||
*
|
||||
* @author jdcasey
|
||||
* @since 2.5
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ package org.apache.maven.tools.plugin;
|
|||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.plugin.descriptor.MojoDescriptor;
|
||||
import org.apache.maven.plugin.descriptor.PluginDescriptor;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
|
||||
|
|
@ -29,7 +28,8 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Request that encapsulates all information relevant to the process of extracting {@link MojoDescriptor}
|
||||
* Request that encapsulates all information relevant to the process of extracting
|
||||
* {@link org.apache.maven.plugin.descriptor.MojoDescriptor MojoDescriptor}
|
||||
* instances from metadata for a certain type of mojo.
|
||||
*
|
||||
* @author jdcasey
|
||||
|
|
@ -85,7 +85,7 @@ public interface PluginToolsRequest
|
|||
PluginToolsRequest setSkipErrorNoDescriptorsFound( boolean skipErrorNoDescriptorsFound );
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @return <code>true</code> if no descriptor found should not cause a failure
|
||||
* @since 3.0
|
||||
*/
|
||||
boolean isSkipErrorNoDescriptorsFound();
|
||||
|
|
@ -93,21 +93,21 @@ public interface PluginToolsRequest
|
|||
/**
|
||||
* Returns the list of {@link Artifact} used in class path scanning for annotations
|
||||
*
|
||||
* @return
|
||||
* @return the dependencies
|
||||
* @since 3.0
|
||||
*/
|
||||
Set<Artifact> getDependencies();
|
||||
|
||||
/**
|
||||
* @param dependencies
|
||||
* @return
|
||||
* @return This request.
|
||||
* @since 3.0
|
||||
*/
|
||||
PluginToolsRequest setDependencies( Set<Artifact> dependencies );
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
* @return the remote repositories
|
||||
* @since 3.0
|
||||
*/
|
||||
List<ArtifactRepository> getRemoteRepos();
|
||||
|
|
@ -115,14 +115,14 @@ public interface PluginToolsRequest
|
|||
/**
|
||||
*
|
||||
* @param remoteRepos
|
||||
* @return
|
||||
* @return This request.
|
||||
* @since 3.0
|
||||
*/
|
||||
PluginToolsRequest setRemoteRepos( List<ArtifactRepository> remoteRepos );
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
* @return the local artifact repository
|
||||
* @since 3.0
|
||||
*/
|
||||
ArtifactRepository getLocal();
|
||||
|
|
@ -130,7 +130,7 @@ public interface PluginToolsRequest
|
|||
/**
|
||||
*
|
||||
* @param local
|
||||
* @return
|
||||
* @return This request.
|
||||
* @since 3.0
|
||||
*/
|
||||
PluginToolsRequest setLocal( ArtifactRepository local );
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue