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 AbstractResolveMojo
Goal 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 -
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanInclude parent poms in the dependency resolution list.private booleanOutput absolute filename for resolved artifactsprivate Stringprotected booleanIf we should display the scope when resolving(package private) DependencyStatusSetsOnly used to store results for integration test validation(package private) booleanSort the output list of resolved artifacts alphabetically.Fields inherited from class org.apache.maven.plugins.dependency.resolvers.AbstractResolveMojo
appendOutput, excludeReactor, outputFileFields 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, typeFields inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
reactorProjects, sessionFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate StringBuilderbuildArtifactListOutput(Set<org.apache.maven.artifact.Artifact> artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) protected voidMain entry into mojo.protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilterReturn anArtifactsFilterindicating which artifacts must be filtered out.getModuleDescriptor(File artifactFile) getOutput(boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) Methods inherited from class org.apache.maven.plugins.dependency.fromDependencies.AbstractDependencyFilterMojo
filterMarkedDependencies, getDependencyResolver, getDependencySets, getDependencySets, getMarkersDirectory, getRepositoryManager, getResolvedDependencies, getResolverUtil, isPrependGroupId, setMarkersDirectory, setPrependGroupIdMethods inherited from class org.apache.maven.plugins.dependency.AbstractDependencyMojo
execute, getProject, isSilent, isSkip, newResolveArtifactProjectBuildingRequest, newResolvePluginProjectBuildingRequest, setSilent, setSkipMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputEncoding
@Parameter(property="outputEncoding", defaultValue="${project.reporting.outputEncoding}") private String outputEncoding -
outputScope
@Parameter(property="mdep.outputScope", defaultValue="true") protected boolean outputScopeIf we should display the scope when resolving- Since:
- 2.0-alpha-2
-
outputAbsoluteArtifactFilename
@Parameter(property="outputAbsoluteArtifactFilename", defaultValue="false") private boolean outputAbsoluteArtifactFilenameOutput absolute filename for resolved artifacts- Since:
- 2.0
-
results
DependencyStatusSets resultsOnly 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
-
-
Constructor Details
-
ResolveDependenciesMojo
public ResolveDependenciesMojo()
-
-
Method Details
-
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
- 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 String getOutput(boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) - Parameters:
outputAbsoluteArtifactFilename- absolute artifact filenametheOutputScope- the output scopetheSort- sort yes/no- Returns:
- the output
-
buildArtifactListOutput
private StringBuilder buildArtifactListOutput(Set<org.apache.maven.artifact.Artifact> artifacts, boolean outputAbsoluteArtifactFilename, boolean theOutputScope, boolean theSort) -
getModuleDescriptor
-