Reputation: 7298
I'm trying to write a custom maven plugin, and want to get some information about the project.
After some searching around, I found that I can set parameters to certain project related values (presumably from the POM?) - e.g.
/**
* @goal myPlugin
*/
public class MyTestMojo extends AbstractMojo {
/**
* @parameter expression="${project}"
* @required
* @read-only
*/
private Object project;
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
getLog().info(project.toString());
}
}
However, I cannot find any documentation on what parameters are available in this format. At the moment, I'm proceeding with trial and error, but that's proving a bit frustrating.
Any ideas?
Upvotes: 2
Views: 569
Reputation: 31795
Here is a short list of available properties. You may also want to look trough available Maven plugin tutorials.
Upvotes: 3
Reputation: 61715
See the Mojo API specification, section The Descriptor and Annotations.
There is a good introduction to writing plugins in Maven: The Complete Reference: 11.4 Writing a Custom Plugin, section 11.4.5. Mojo Class Annotations on the Sonatype website.
Upvotes: 2