Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With the MavenProject object, you would be able to access a lot of things ( that is if you don't know the @component or @expression for it.

Code Block
/** @parameter expressiondefault-value="${project}" */
private org.apache.maven.project.MavenProject mavenProject;

...

The dependencies declared in your plugin.


Code Block
/** @parameter expressiondefault-value="${plugin.artifacts}" */
private java.util.List pluginArtifacts;

...

Code Block
/** @component */
private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;

/** @component */
private org.apache.maven.artifact.resolver.ArtifactResolver resolver;

/**@parameter expressiondefault-value="${localRepository}" */
private org.apache.maven.artifact.repository.ArtifactRepository localRepository;

/** @parameter expressiondefault-value="${project.remoteArtifactRepositories}" */
private java.util.List remoteRepositories;

/** @parameter expressiondefault-value="${project.distributionManagementArtifactRepository}" */
private ArtifactRepository deploymentRepository;

...


You may want to add @required and @readonly, but I dropped them to keep it short.

The ones listed here are the common ones. But you can use other properties in expressiondefault-value="${...}". See MavenPropertiesGuide for more info...

...


In this snippet, project is the MavenProject instance of the project (@parameter expressiondefault-value="${project}") and dependency is instance of Dependency (@parameter expressiondefault-value="${project.dependencies}).