Is it possible to get the artifactId of the current Mojo?
@Mojo(...)
public class MyMojo extends AbstractMojo {
@Parameter(property = "project")
private MavenProject project;
@Parameter(property = "inputDirectory", defaultValue = "${project.basedir}/src/main/${artifact id of the plugin}")
private File inputDirectory;
...
I could hardcode the artifact id of the plugin, but I would rather get it dynamically.
BTW what comes into my mind is that you are using old style injection
@Parameter(property = "project")
private MavenProject project;
@Parameter(property = "inputDirectory", defaultValue = "${project.basedir}/src/main/${artifact id of the plugin}")
private File inputDirectory;
The expression values for defaultValue are documented here: http://maven.apache.org/ref/3.1.1/maven-core/apidocs/org/apache/maven/plugin/PluginParameterExpressionEvaluator.html depending on your used Maven version.
@Parameter(defaultValue = "${project}, required = true, readonly = true)
private MavenProject project;
@Parameter(defaultValue = "${project.basedir}/src/main/${artifact id of the plugin}", property = "inputDirectory", required = true)
private File inputDirectory;