Class ResolveDependenciesMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.plugins.dependency.AbstractDependencyMojo
-
- org.apache.maven.plugins.dependency.fromDependencies.AbstractDependencyFilterMojo
-
- org.apache.maven.plugins.dependency.resolvers.AbstractResolveMojo
-
- org.apache.maven.plugins.dependency.resolvers.ResolveDependenciesMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CollectDependenciesMojo,ListMojo,ResolveDependencySourcesMojo
@Mojo(name="resolve", requiresDependencyResolution=TEST, defaultPhase=GENERATE_SOURCES, threadSafe=true) public class ResolveDependenciesMojo extends AbstractResolveMojoGoal that resolves the project dependencies from the repository. When using this goal while running on Java 9 the module names will be visible as well.- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classResolveDependenciesMojo.ModuleDescriptor
-
Field Summary
Fields Modifier and Type Field Description (package private) booleanincludeParentsInclude parent poms in the dependency resolution list.protected booleanoutputScopeIf we should display the scope when resolving(package private) DependencyStatusSetsresultsOnly used to store results for integration test validation(package private) booleansortSort the output list of resolved artifacts alphabetically.-
Fields inherited from class org.apache.maven.plugins.dependency.resolvers.AbstractResolveMojo
appendOutput, excludeReactor, ignorePermissions, outputFile, useJvmChmod
-
Fields inherited from class org.apache.maven.plugins.dependency.fromDependencies.AbstractDependencyFilterMojo
classifier, excludeArtifactIds, excludeClassifiers, excludeGroupIds, excludeScope, excludeTransitive, excludeTypes, includeArtifactIds, includeClassifiers, includeGroupIds, includeScope, includeTypes, markersDirectory, overWriteIfNewer, overWriteReleases, overWriteSnapshots, prependGroupId, type
-
Fields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
outputAbsoluteArtifactFilename, reactorProjects, session
-
-
Constructor Summary
Constructors Constructor Description ResolveDependenciesMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.StringBuilderbuildArtifactListOutput(java.util.Set<org.apache.maven.artifact.Artifact> artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort)protected voiddoExecute()Main entry into mojo.protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFiltergetMarkedArtifactFilter()Return anArtifactsFilterindicating which artifacts must be filtered out.private ResolveDependenciesMojo.ModuleDescriptorgetModuleDescriptor(java.io.File artifactFile)java.lang.StringgetOutput(boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort)DependencyStatusSetsgetResults()-
Methods inherited from class org.apache.maven.plugins.dependency.resolvers.AbstractResolveMojo
getArtifactsFilter, resolveArtifactDependencies
-
Methods inherited from class org.apache.maven.plugins.dependency.fromDependencies.AbstractDependencyFilterMojo
filterMarkedDependencies, getArtifactResolver, getClassifierTranslatedDependencies, getDependencyResolver, getDependencySets, getDependencySets, getMarkersDirectory, getRepositoryManager, getResolvedDependencies, isPrependGroupId, resolve, setMarkersDirectory, setPrependGroupId
-
Methods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
copyFile, execute, getArchiverManager, getProject, isSilent, isSkip, isUseJvmChmod, newResolveArtifactProjectBuildingRequest, setArchiverManager, setSilent, setSkip, setUseJvmChmod, unpack, unpack, unpack
-
-
-
-
Field Detail
-
outputScope
@Parameter(property="mdep.outputScope", defaultValue="true") protected boolean outputScopeIf we should display the scope when resolving- Since:
- 2.0-alpha-2
-
results
DependencyStatusSets results
Only used to store results for integration test validation
-
sort
@Parameter(property="sort", defaultValue="false") boolean sortSort the output list of resolved artifacts alphabetically. The default ordering matches the classpath order.- Since:
- 2.8
-
includeParents
@Parameter(property="includeParents", defaultValue="false") boolean includeParentsInclude parent poms in the dependency resolution list.- Since:
- 2.8
-
-
Method Detail
-
doExecute
protected void doExecute() throws org.apache.maven.plugin.MojoExecutionExceptionMain entry into mojo. Gets the list of dependencies and iterates through displaying the resolved version.- Specified by:
doExecutein classAbstractDependencyMojo- Throws:
org.apache.maven.plugin.MojoExecutionException- with a message if an error occurs.
-
getResults
public DependencyStatusSets getResults()
- Returns:
- Returns the results.
-
getMarkedArtifactFilter
protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
Description copied from class:AbstractDependencyFilterMojoReturn anArtifactsFilterindicating which artifacts must be filtered out.- Specified by:
getMarkedArtifactFilterin classAbstractDependencyFilterMojo- Returns:
- an
ArtifactsFilterindicating which artifacts must be filtered out.
-
getOutput
public java.lang.String getOutput(boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort)- Parameters:
outputAbsoluteArtifactFilename- absolute artfiact filename.theOutputScope- The output scope.theSort- sort yes/no.- Returns:
- The output.
-
buildArtifactListOutput
private java.lang.StringBuilder buildArtifactListOutput(java.util.Set<org.apache.maven.artifact.Artifact> artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort)
-
getModuleDescriptor
private ResolveDependenciesMojo.ModuleDescriptor getModuleDescriptor(java.io.File artifactFile)
-
-