[MPLUGIN-249] give snippets to show use of expressions to get Maven objects
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1505210 13f79535-47bb-0310-9956-ffa450edef68master
parent
a1e15b0b7b
commit
9c26ce960d
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
Maven Plugin Tool for Annotations
|
Maven Plugin Tool for Annotations
|
||||||
|
|
||||||
The Maven Plugin Tool for Annotations is the impl of {{{../maven-plugin-tools-api/index.html}maven-plugin-tools-api}}
|
The Maven Plugin Tool for Annotations is the implementation of {{{../maven-plugin-tools-api/index.html}maven-plugin-tools-api}}
|
||||||
to extract descriptors from plugins written in Java with
|
to extract descriptors from plugins written in Java with
|
||||||
{{{../maven-plugin-annotations/index.html}Maven Plugin Tools Java 5 Annotations}}.
|
{{{../maven-plugin-annotations/index.html}Maven Plugin Tools Java 5 Annotations}}.
|
||||||
|
|
||||||
|
|
@ -104,6 +104,13 @@ public class MyMojo
|
||||||
@Component
|
@Component
|
||||||
private Settings settings;
|
private Settings settings;
|
||||||
|
|
||||||
|
// sample objects taken from Maven API through PluginParameterExpressionEvaluator
|
||||||
|
@Parameter( defaultValue = "${basedir}", readonly = true )
|
||||||
|
private File basedir;
|
||||||
|
|
||||||
|
@Parameter( defaultValue = "${project.build.directory}", readonly = true )
|
||||||
|
private File target;
|
||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
|
|
@ -119,3 +126,6 @@ public class MyMojo
|
||||||
* {{{/developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo API Specification}}
|
* {{{/developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo API Specification}}
|
||||||
|
|
||||||
* {{{/ref/current/maven-plugin-api/plugin.html}META-INF/maven/plugin.xml plugin descriptor}}
|
* {{{/ref/current/maven-plugin-api/plugin.html}META-INF/maven/plugin.xml plugin descriptor}}
|
||||||
|
|
||||||
|
* {{{/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}PluginParameterExpressionEvaluator}},
|
||||||
|
used to evaluate plugin parameters values during Mojo configuration,
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,19 @@ public class MyMojo
|
||||||
*/
|
*/
|
||||||
private Settings settings;
|
private Settings settings;
|
||||||
|
|
||||||
|
// sample objects taken from Maven API through PluginParameterExpressionEvaluator
|
||||||
|
/**
|
||||||
|
* @parameter default-value="${basedir}"
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
private File basedir;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @parameter default-value="${project.build.directory}"
|
||||||
|
* @readonly
|
||||||
|
*/
|
||||||
|
private File target;
|
||||||
|
|
||||||
public void execute()
|
public void execute()
|
||||||
{
|
{
|
||||||
...
|
...
|
||||||
|
|
@ -120,3 +133,6 @@ public class MyMojo
|
||||||
* {{{/developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo API Specification}}
|
* {{{/developers/mojo-api-specification.html#The_Descriptor_and_Annotations}Mojo API Specification}}
|
||||||
|
|
||||||
* {{{/ref/current/maven-plugin-api/plugin.html}<<<META-INF/maven/plugin.xml>>> plugin descriptor}}
|
* {{{/ref/current/maven-plugin-api/plugin.html}<<<META-INF/maven/plugin.xml>>> plugin descriptor}}
|
||||||
|
|
||||||
|
* {{{/ref/current/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html}PluginParameterExpressionEvaluator}},
|
||||||
|
used to evaluate plugin parameters values during Mojo configuration,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue