Class AbstractDependencyVersionsMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
,Context
- Direct Known Subclasses:
DependencyVersionsCheckMojo
,DependencyVersionsListMojo
-
Field Summary
Modifier and TypeFieldDescriptionboolean
Use deep scan or regular scan.Sets the default strategy to use to evaluate whether two dependency versions are compatible or not.boolean
List only direct dependencies or all dependencies.List of version checks that will be removed from the version check.boolean
Run dependency resolution in parallel with multiple threads.boolean
Include POM projects when running on a multi-module project.boolean
List only managed dependencies or all dependencies.org.apache.maven.project.ProjectBuilder
org.apache.maven.execution.MavenSession
org.apache.maven.project.MavenProject
org.apache.maven.project.ProjectDependenciesResolver
boolean
Silence all non-output and non-error messages.List<org.apache.maven.project.MavenProject>
org.eclipse.aether.RepositorySystem
List of resolvers to apply specific strategies to dependencies.Dependency resolution scope.boolean
Skip the plugin execution.The strategy provider.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.maven.project.ProjectBuildingRequest
org.eclipse.aether.resolution.VersionRangeRequest
createVersionRangeRequest
(org.eclipse.aether.artifact.Artifact artifact) void
execute()
org.apache.maven.project.ProjectBuilder
org.apache.maven.project.ProjectDependenciesResolver
List<org.apache.maven.project.MavenProject>
org.eclipse.aether.RepositorySystem
org.eclipse.aether.RepositorySystemSession
org.apache.maven.project.MavenProject
boolean
boolean
boolean
boolean
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
project
@Parameter(defaultValue="${project}", readonly=true) public org.apache.maven.project.MavenProject project -
mavenSession
@Parameter(defaultValue="${session}", readonly=true) public org.apache.maven.execution.MavenSession mavenSession -
reactorProjects
@Parameter(defaultValue="${reactorProjects}", readonly=true, required=true) public List<org.apache.maven.project.MavenProject> reactorProjects -
mavenProjectBuilder
-
projectDependenciesResolver
-
repositorySystem
-
strategyProvider
The strategy provider. This can be requested by other pieces to add additional strategies. -
exclusions
List of version checks that will be removed from the version check. This allows potential conflicts to be excluded.
<exclusions> <exclusion> <dependency>...</dependency> <expected>...</expected> <resolved>...</resolved> </exclusion> </exclusions>
Each element consists of a dependency pattern
[groupId]:[artifactId]
that supports wildcards and an expected version (which is the version is expected by the artifact) and a resolved version (the version that the dependency resolution has chosen). -
skip
Skip the plugin execution. -
includePomProjects
@Parameter(defaultValue="false", property="dvc.include-pom-projects") public boolean includePomProjectsInclude POM projects when running on a multi-module project. Dependency resolution on a pom project almost never makes sense as it does not actually build any artifacts.- Since:
- 3.0.0
-
quiet
Silence all non-output and non-error messages.- Since:
- 3.0.0
-
scope
Dependency resolution scope. Defaults totest
. Valid choices arecompile+runtime
,compile
,test
andruntime
.- Since:
- 3.0.0
-
deepScan
Use deep scan or regular scan. Deep scan looks at all dependencies in the dependency tree, while regular scan only looks one level deep into the direct dependencies.- Since:
- 3.0.0
-
directOnly
List only direct dependencies or all dependencies.- Since:
- 3.0.0
-
managedOnly
List only managed dependencies or all dependencies.- Since:
- 3.0.0
-
fastResolution
Run dependency resolution in parallel with multiple threads. Should only ever set tofalse
if the plugin shows stability problems when resolving dependencies. Please file a bug in that case, too.- Since:
- 3.0.0
-
resolvers
List of resolvers to apply specific strategies to dependencies.<resolvers> <resolver> <strategy>...<strategy> <includes> <include>...<include> <includes> <resolver> <resolvers>
A resolver maps a specific strategy to a list of includes. The include syntax is
[group-id]:[artifact-id]
where each pattern segment supports full and partial wildcards (*
).
The plugin includes some default strategies:apr
,default
,single-digit
andtwo-digits-backward-compatible
. Additional strategies can be defined and added to the plugin classpath. -
defaultStrategy
Sets the default strategy to use to evaluate whether two dependency versions are compatible or not.The
default
resolution strategy matches the Maven dependency resolution itself; any two dependencies that maven considers compatible will be accepted.- Since:
- 3.0.0
-
-
Constructor Details
-
AbstractDependencyVersionsMojo
public AbstractDependencyVersionsMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
useFastResolution
- Specified by:
useFastResolution
in interfaceContext
- Returns:
- True if the resolver should use multiple threads.
-
useDeepScan
- Specified by:
useDeepScan
in interfaceContext
- Returns:
- True if a deep scan should be performed instead of regular scan.
-
isOptionalDependenciesMustExist
- Specified by:
isOptionalDependenciesMustExist
in interfaceContext
- Returns:
- True if all optional dependencies must exist.
-
getStrategyCache
- Specified by:
getStrategyCache
in interfaceContext
- Returns:
- The lookup cache for the Strategy resolution
-
getProjectBuilder
- Specified by:
getProjectBuilder
in interfaceContext
- Returns:
- The Maven project builder.
-
getProjectDependenciesResolver
- Specified by:
getProjectDependenciesResolver
in interfaceContext
- Returns:
- The Maven project dependency resolver.
-
getRootProject
- Specified by:
getRootProject
in interfaceContext
- Returns:
- The root project.
-
getReactorProjects
- Specified by:
getReactorProjects
in interfaceContext
- Returns:
- All projects that are in the current reactor.
-
getRepositorySystemSession
- Specified by:
getRepositorySystemSession
in interfaceContext
- Returns:
- The repository session
-
getRepositorySystem
- Specified by:
getRepositorySystem
in interfaceContext
- Returns:
- The repository system for dependency resolution.
-
createProjectBuildingRequest
- Specified by:
createProjectBuildingRequest
in interfaceContext
- Returns:
- A new project building request.
-
createVersionRangeRequest
public org.eclipse.aether.resolution.VersionRangeRequest createVersionRangeRequest(org.eclipse.aether.artifact.Artifact artifact) - Specified by:
createVersionRangeRequest
in interfaceContext
- Parameters:
artifact
- The artifact to define the version range resolution request.- Returns:
- A version range resolution request.
-
getExclusions
- Specified by:
getExclusions
in interfaceContext
- Returns:
- All configured exclusions.
-
isUnresolvedSystemArtifactsFailBuild
- Specified by:
isUnresolvedSystemArtifactsFailBuild
in interfaceContext
- Returns:
- True if any unresolved system artifacts should fail the build.
-