Fork me on GitHub

dependency-versions-check:check

Full name:

org.basepom.maven:dependency-versions-check-maven-plugin:4.0.0:check

Description:

Resolves all dependencies of a project and reports version conflicts.

Attributes:

  • Requires a Maven project to be executed.
  • The goal is thread-safe and supports parallel builds.
  • Binds by default to the lifecycle phase: verify.

Optional Parameters

Name Type Since Description
<conflictsFailBuild> boolean 3.0.0 Fail the build if a conflict is detected. Any conflict (direct and transitive) will cause a failure.
Default value is: false.
User property is: dvc.conflicts-fail-build.
Alias is: failBuildInCaseOfConflict.
<conflictsOnly> boolean 3.0.0 List only dependencies in conflict or all dependencies.
Default value is: true.
User property is: dvc.conflicts-only.
<deepScan> boolean 3.0.0 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.
Default value is: false.
User property is: dvc.deep-scan.
<defaultStrategy> String 3.0.0 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.
Default value is: default.
User property is: dvc.default-strategy.
<directConflictsFailBuild> boolean 3.0.0 Fail the build only if a version conflict involves one or more direct dependencies. Direct dependency versions are controlled by the project itself so any conflict here can be fixed by changing the version in the project.
It is strongly recommended to review and fix these conflicts.
Default value is: false.
User property is: dvc.direct-conflicts-fail-build.
<directOnly> boolean 3.0.0 List only direct dependencies or all dependencies.
Default value is: false.
User property is: dvc.direct-only.
<exclusions> VersionCheckExcludes[] - 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).


Alias is: exceptions.
<fastResolution> boolean 3.0.0 Run dependency resolution in parallel with multiple threads. Should only ever set to false if the plugin shows stability problems when resolving dependencies. Please file a bug in that case, too.
Default value is: true.
User property is: dvc.fast-resolution.
<includePomProjects> boolean 3.0.0 Include 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.
Default value is: false.
User property is: dvc.include-pom-projects.
<managedOnly> boolean 3.0.0 List only managed dependencies or all dependencies.
Default value is: false.
User property is: dvc.managed-only.
<optionalDependenciesMustExist> boolean 3.2.0 Require all optional dependencies to exist and fail the build if any optional dependency can not resolved. This is almost never needed and actually causes problems for some projects that use large public dependencies from central that in turn pull in non-public dependencies as optional.
Default value is: false.
User property is: dvc.optional-dependencies-must-exist.
<quiet> boolean 3.0.0 Silence all non-output and non-error messages.
Default value is: false.
User property is: dvc.quiet.
<resolvers> ResolverDefinition[] - 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 and two-digits-backward-compatible. Additional strategies can be defined and added to the plugin classpath.
<scope> String 3.0.0 Dependency resolution scope. Defaults to test. Valid choices are compile+runtime, compile, test and runtime.
Default value is: test.
User property is: scope.
<skip> boolean - Skip the plugin execution.
Default value is: false.
User property is: dvc.skip.
<unresolvedSystemArtifactsFailBuild> boolean 3.0.0 Fail the build if an artifact in system scope can not be resolved. Those are notoriously dependent on the local build environment and some outright fail (e.g. referencing the tools.jar, which no longer exists in a JDK8+ environment).
Setting this flag to true will fail the build if any system scoped artifact can not be resolved. This is almost never desired, except when building a project with a direct system scoped dependency.
Default value is: false.
User property is: dvc.unresolved-system-artifacts-fail-build.

Parameter Details

<conflictsFailBuild>

Fail the build if a conflict is detected. Any conflict (direct and transitive) will cause a failure.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.conflicts-fail-build
  • Default: false
  • Alias: failBuildInCaseOfConflict

<conflictsOnly>

List only dependencies in conflict or all dependencies.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.conflicts-only
  • Default: true

<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.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.deep-scan
  • Default: false

<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.
  • Type: java.lang.String
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.default-strategy
  • Default: default

<directConflictsFailBuild>

Fail the build only if a version conflict involves one or more direct dependencies. Direct dependency versions are controlled by the project itself so any conflict here can be fixed by changing the version in the project.
It is strongly recommended to review and fix these conflicts.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.direct-conflicts-fail-build
  • Default: false

<directOnly>

List only direct dependencies or all dependencies.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.direct-only
  • Default: false

<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).

  • Type: org.basepom.mojo.dvc.model.VersionCheckExcludes[]
  • Required: No
  • Alias: exceptions

<fastResolution>

Run dependency resolution in parallel with multiple threads. Should only ever set to false if the plugin shows stability problems when resolving dependencies. Please file a bug in that case, too.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.fast-resolution
  • Default: true

<includePomProjects>

Include 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.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.include-pom-projects
  • Default: false

<managedOnly>

List only managed dependencies or all dependencies.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.managed-only
  • Default: false

<optionalDependenciesMustExist>

Require all optional dependencies to exist and fail the build if any optional dependency can not resolved. This is almost never needed and actually causes problems for some projects that use large public dependencies from central that in turn pull in non-public dependencies as optional.
  • Type: boolean
  • Since: 3.2.0
  • Required: No
  • User Property: dvc.optional-dependencies-must-exist
  • Default: false

<quiet>

Silence all non-output and non-error messages.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.quiet
  • Default: false

<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 and two-digits-backward-compatible. Additional strategies can be defined and added to the plugin classpath.
  • Type: org.basepom.mojo.dvc.model.ResolverDefinition[]
  • Required: No

<scope>

Dependency resolution scope. Defaults to test. Valid choices are compile+runtime, compile, test and runtime.
  • Type: java.lang.String
  • Since: 3.0.0
  • Required: No
  • User Property: scope
  • Default: test

<skip>

Skip the plugin execution.
  • Type: boolean
  • Required: No
  • User Property: dvc.skip
  • Default: false

<unresolvedSystemArtifactsFailBuild>

Fail the build if an artifact in system scope can not be resolved. Those are notoriously dependent on the local build environment and some outright fail (e.g. referencing the tools.jar, which no longer exists in a JDK8+ environment).
Setting this flag to true will fail the build if any system scoped artifact can not be resolved. This is almost never desired, except when building a project with a direct system scoped dependency.
  • Type: boolean
  • Since: 3.0.0
  • Required: No
  • User Property: dvc.unresolved-system-artifacts-fail-build
  • Default: false