Class AbstractDependencyVersionsMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo,Context
- Direct Known Subclasses:
DependencyVersionsCheckMojo,DependencyVersionsListMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanUse deep scan or regular scan.Sets the default strategy to use to evaluate whether two dependency versions are compatible or not.booleanList only direct dependencies or all dependencies.List of version checks that will be removed from the version check.booleanRun dependency resolution in parallel with multiple threads.booleanInclude POM projects when running on a multi-module project.booleanList only managed dependencies or all dependencies.org.apache.maven.project.ProjectBuilderorg.apache.maven.execution.MavenSessionorg.apache.maven.project.MavenProjectorg.apache.maven.project.ProjectDependenciesResolverbooleanSilence all non-output and non-error messages.List<org.apache.maven.project.MavenProject>org.eclipse.aether.RepositorySystemList of resolvers to apply specific strategies to dependencies.Dependency resolution scope.booleanSkip the plugin execution.The strategy provider.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.maven.project.ProjectBuildingRequestorg.eclipse.aether.resolution.VersionRangeRequestcreateVersionRangeRequest(org.eclipse.aether.artifact.Artifact artifact) voidexecute()org.apache.maven.project.ProjectBuilderorg.apache.maven.project.ProjectDependenciesResolverList<org.apache.maven.project.MavenProject>org.eclipse.aether.RepositorySystemorg.eclipse.aether.RepositorySystemSessionorg.apache.maven.project.MavenProjectbooleanbooleanbooleanbooleanMethods 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,testandruntime.- 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 tofalseif 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-digitandtwo-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
defaultresolution 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:
executein interfaceorg.apache.maven.plugin.Mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
useFastResolution
- Specified by:
useFastResolutionin interfaceContext- Returns:
- True if the resolver should use multiple threads.
-
useDeepScan
- Specified by:
useDeepScanin interfaceContext- Returns:
- True if a deep scan should be performed instead of regular scan.
-
isOptionalDependenciesMustExist
- Specified by:
isOptionalDependenciesMustExistin interfaceContext- Returns:
- True if all optional dependencies must exist.
-
getStrategyCache
- Specified by:
getStrategyCachein interfaceContext- Returns:
- The lookup cache for the Strategy resolution
-
getProjectBuilder
- Specified by:
getProjectBuilderin interfaceContext- Returns:
- The Maven project builder.
-
getProjectDependenciesResolver
- Specified by:
getProjectDependenciesResolverin interfaceContext- Returns:
- The Maven project dependency resolver.
-
getRootProject
- Specified by:
getRootProjectin interfaceContext- Returns:
- The root project.
-
getReactorProjects
- Specified by:
getReactorProjectsin interfaceContext- Returns:
- All projects that are in the current reactor.
-
getRepositorySystemSession
- Specified by:
getRepositorySystemSessionin interfaceContext- Returns:
- The repository session
-
getRepositorySystem
- Specified by:
getRepositorySystemin interfaceContext- Returns:
- The repository system for dependency resolution.
-
createProjectBuildingRequest
- Specified by:
createProjectBuildingRequestin interfaceContext- Returns:
- A new project building request.
-
createVersionRangeRequest
public org.eclipse.aether.resolution.VersionRangeRequest createVersionRangeRequest(org.eclipse.aether.artifact.Artifact artifact) - Specified by:
createVersionRangeRequestin interfaceContext- Parameters:
artifact- The artifact to define the version range resolution request.- Returns:
- A version range resolution request.
-
getExclusions
- Specified by:
getExclusionsin interfaceContext- Returns:
- All configured exclusions.
-
isUnresolvedSystemArtifactsFailBuild
- Specified by:
isUnresolvedSystemArtifactsFailBuildin interfaceContext- Returns:
- True if any unresolved system artifacts should fail the build.
-