Class PropertiesMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.dependency.PropertiesMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="properties", requiresDependencyResolution=TEST, defaultPhase=INITIALIZE, threadSafe=true) public class PropertiesMojo extends org.apache.maven.plugin.AbstractMojoGoal that sets a property pointing to the artifact file for each project dependency. For each dependency (direct and transitive) a project property will be set which follows thegroupId:artifactId:type:[classifier]form and contains the path to the resolved artifact.- Since:
- 2.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ParamArtifact>extraArtifactsExtra artifacts that can be provided to the plugin.private org.apache.maven.project.MavenProjectprojectThe current Maven project.private ResolverUtilresolverUtilprivate booleanskipSkip plugin execution completely.
-
Constructor Summary
Constructors Constructor Description PropertiesMojo(org.apache.maven.project.MavenProject project, ResolverUtil resolverUtil)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Main entry into mojo.booleanisSkip()private java.lang.StringtoConflictId(org.eclipse.aether.artifact.Artifact artifact)
-
-
-
Field Detail
-
project
private final org.apache.maven.project.MavenProject project
The current Maven project.
-
resolverUtil
private final ResolverUtil resolverUtil
-
skip
@Parameter(property="mdep.skip", defaultValue="false") private boolean skipSkip plugin execution completely.- Since:
- 2.7
-
extraArtifacts
@Parameter private java.util.List<ParamArtifact> extraArtifacts
Extra artifacts that can be provided to the plugin. For each artifact in this list a property will be set similar to the project artifacts discovered. This allows callers to supply additional resolved dependencies for which properties pointing to the artifact file shall be created. Example usage in plugin configuration:<extraArtifacts> <extraArtifact> <artifact>org.example:my-artifact:jar:1.0</artifact> </extraArtifact> <extraArtifact> <groupId>org.example</groupId> <artifactId>my-artifact</artifactId> <version>1.0</version> </extraArtifact> </extraArtifacts>- Since:
- 3.11.0
-
-
Constructor Detail
-
PropertiesMojo
@Inject public PropertiesMojo(org.apache.maven.project.MavenProject project, ResolverUtil resolverUtil)
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionMain entry into mojo. Gets the list of dependencies and iterates through setting a property for each artifact. Gets the list of declared plugin's extra artifacts and iterates through setting a property for each artifact.- Throws:
org.apache.maven.plugin.MojoExecutionException- with a message if an error occurs
-
isSkip
public boolean isSkip()
- Returns:
skip
-
toConflictId
private java.lang.String toConflictId(org.eclipse.aether.artifact.Artifact artifact)
-
-