MPLUGIN-45: Plugin dependencies are not put in generated plugin.xml
o honor the code in AbstractGeneratorMojo#execute(), i.e. project.getRuntimeDependencies() o improved doc git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@630836 13f79535-47bb-0310-9956-ffa450edef68master
parent
c1d3815395
commit
65d8620ee9
|
|
@ -33,6 +33,7 @@ import java.io.File;
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
* @goal descriptor
|
* @goal descriptor
|
||||||
* @phase generate-resources
|
* @phase generate-resources
|
||||||
|
* @requiresDependencyResolution runtime
|
||||||
*/
|
*/
|
||||||
public class DescriptorGeneratorMojo
|
public class DescriptorGeneratorMojo
|
||||||
extends AbstractGeneratorMojo
|
extends AbstractGeneratorMojo
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
------
|
------
|
||||||
Maria Odea Ching
|
Maria Odea Ching
|
||||||
------
|
------
|
||||||
July 2006
|
February 2008
|
||||||
------
|
------
|
||||||
|
|
||||||
~~ Licensed to the Apache Software Foundation (ASF) under one
|
~~ Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
|
@ -50,3 +50,65 @@ Configuring Generation of Plugin Descriptor
|
||||||
The <<<goalPrefix>>> parameter will set the goal prefix for the plugin that is specified in the descriptor. The <<<outputDirectory>>>
|
The <<<goalPrefix>>> parameter will set the goal prefix for the plugin that is specified in the descriptor. The <<<outputDirectory>>>
|
||||||
parameter, on the other hand, specifies the target location of the generated plugin descriptor.
|
parameter, on the other hand, specifies the target location of the generated plugin descriptor.
|
||||||
|
|
||||||
|
* Example
|
||||||
|
|
||||||
|
For instance, if we make reference on <<<MyMojo>>> from <<<maven-my-plugin>>> which is generated by the
|
||||||
|
Maven Archetype Plugin, i.e.:
|
||||||
|
|
||||||
|
-----
|
||||||
|
mvn archetype:create \
|
||||||
|
-DgroupId=org.apache.maven.plugin.my \
|
||||||
|
-DartifactId=maven-my-plugin \
|
||||||
|
-DarchetypeArtifactId=maven-archetype-mojo
|
||||||
|
-----
|
||||||
|
|
||||||
|
The generated plugin descriptor generated by <<<mvn package>>> should be:
|
||||||
|
|
||||||
|
-----
|
||||||
|
<plugin>
|
||||||
|
<description></description>
|
||||||
|
<groupId>org.apache.maven.plugin.my</groupId>
|
||||||
|
<artifactId>maven-my-plugin</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<goalPrefix>my</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.plugin.my.MyMojo</implementation>
|
||||||
|
<language>java</language>
|
||||||
|
<instantiationStrategy>per-lookup</instantiationStrategy>
|
||||||
|
<executionStrategy>once-per-session</executionStrategy>
|
||||||
|
<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>
|
||||||
|
-----
|
||||||
Loading…
Reference in New Issue