dependency:build-classpath

Full name:

org.apache.maven.plugins:maven-dependency-plugin:3.6.0:build-classpath

Description:

This goal outputs a classpath string of dependencies from the local repository to a file or log.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: test.
  • The goal is thread-safe and supports parallel builds.
  • Since version: 2.0-alpha-2.
  • Binds by default to the lifecycle phase: generate-sources.

Optional Parameters

Name Type Since Description
<attach> boolean 2.0 Attach the classpath file to the main artifact so it can be installed and deployed.
Default value is: false.
<classifier> String 2.0 Specify classifier to look for. Example: sources
User property is: classifier.
<excludeArtifactIds> String 2.0 Comma separated list of Artifact names to exclude.
User property is: excludeArtifactIds.
<excludeClassifiers> String 2.0 Comma Separated list of Classifiers to exclude. Empty String indicates don't exclude anything (default).
User property is: excludeClassifiers.
<excludeGroupIds> String 2.0 Comma separated list of GroupId Names to exclude.
User property is: excludeGroupIds.
<excludeScope> String 2.0 Scope threshold to exclude, if no value is defined for include. An empty string indicates no dependencies (default).
The scope threshold value being interpreted is the scope as Maven filters for creating a classpath, not as specified in the pom. In summary:
  • runtime exclude scope excludes runtime and compile dependencies,
  • compile exclude scope excludes compile, provided, and system dependencies,
  • test exclude scope excludes all dependencies, then not really a legitimate option: it will fail, you probably meant to configure includeScope = compile
  • provided exclude scope just excludes provided dependencies,
  • system exclude scope just excludes system dependencies.

User property is: excludeScope.
<excludeTransitive> boolean 2.0 If we should exclude transitive dependencies
Default value is: false.
User property is: excludeTransitive.
<excludeTypes> String 2.0 Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default).
User property is: excludeTypes.
<fileSeparator> String 2.0 Override the char used between the paths. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\'. The default is File.separator
User property is: mdep.fileSeparator.
<includeArtifactIds> String 2.0 Comma separated list of Artifact names to include. Empty String indicates include everything (default).
User property is: includeArtifactIds.
<includeClassifiers> String 2.0 Comma Separated list of Classifiers to include. Empty String indicates include everything (default).
User property is: includeClassifiers.
<includeGroupIds> String 2.0 Comma separated list of GroupIds to include. Empty String indicates include everything (default).
User property is: includeGroupIds.
<includeScope> String 2.0 Scope threshold to include. An empty string indicates include all dependencies (default).
The scope threshold value being interpreted is the scope as Maven filters for creating a classpath, not as specified in the pom. In summary:
  • runtime include scope gives runtime and compile dependencies,
  • compile include scope gives compile, provided, and system dependencies,
  • test include scope gives all dependencies (equivalent to default),
  • provided include scope just gives provided dependencies,
  • system include scope just gives system dependencies.

User property is: includeScope.
<includeTypes> String 2.0 Comma Separated list of Types to include. Empty String indicates include everything (default).
User property is: includeTypes.
<localRepoProperty> String 2.0 Replace the absolute path to the local repo with this property. This field is ignored it prefix is declared. The value will be forced to "${M2_REPO}" if no value is provided AND the attach flag is true.
User property is: mdep.localRepoProperty.
<markersDirectory> File 2.0 Directory to store flag files
Default value is: ${project.build.directory}/dependency-maven-plugin-markers.
User property is: markersDirectory.
<outputAbsoluteArtifactFilename> boolean 2.0 Output absolute filename for resolved artifacts
Default value is: false.
User property is: outputAbsoluteArtifactFilename.
<outputEncoding> String - (no description)
Default value is: ${project.reporting.outputEncoding}.
User property is: outputEncoding.
<outputFile> File - The file to write the classpath string. If undefined, it just prints the classpath as [INFO].
User property is: mdep.outputFile.
<outputFilterFile> boolean 2.0 Write out the classpath in a format compatible with filtering (classpath=xxxxx)
Default value is: false.
User property is: mdep.outputFilterFile.
<outputProperty> String - A property to set to the content of the classpath string.
User property is: mdep.outputProperty.
<overWriteIfNewer> boolean 2.0 Overwrite artifacts that don't exist or are older than the source.
Default value is: true.
User property is: overWriteIfNewer.
<overWriteReleases> boolean 1.0 Overwrite release artifacts
Default value is: false.
User property is: overWriteReleases.
<overWriteSnapshots> boolean 1.0 Overwrite snapshot artifacts
Default value is: false.
User property is: overWriteSnapshots.
<pathSeparator> String 2.0 Override the char used between path folders. The system-dependent path-separator character. This field is initialized to contain the first character of the value of the system property path.separator. This character is used to separate filenames in a sequence of files given as a path list. On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'.
User property is: mdep.pathSeparator.
<prefix> String - The prefix to prepend on each dependent artifact. If undefined, the paths refer to the actual files store in the local repository (the stripVersion parameter does nothing then).
User property is: mdep.prefix.
<prependGroupId> boolean 2.2 Prepend the groupId during copy.
Default value is: false.
User property is: mdep.prependGroupId.
<regenerateFile> boolean - If 'true', it skips the up-to-date-check, and always regenerates the classpath file.
Default value is: false.
User property is: mdep.regenerateFile.
<silent> boolean 2.0 If the plugin should be silent.
Default value is: false.
User property is: silent.
<skip> boolean 2.7 Skip plugin execution completely.
Default value is: false.
User property is: mdep.skip.
<skipDuringIncrementalBuild> boolean 3.4.0 Skip plugin execution only during incremental builds (e.g. triggered from M2E).
See also: org.apache.maven.plugins.dependency.AbstractDependencyMojo.skip
Default value is: false.
<stripClassifier> boolean - Strip artifact classifier during copy (only works if prefix is set)
Default value is: false.
User property is: mdep.stripClassifier.
<stripVersion> boolean - Strip artifact version during copy (only works if prefix is set)
Default value is: false.
User property is: mdep.stripVersion.
<type> String 2.0 Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war
User property is: type.
<useBaseVersion> boolean 2.6 Either append the artifact's baseVersion or uniqueVersion to the filename. Will only be used if isStripVersion() is false.
Default value is: true.
User property is: mdep.useBaseVersion.

Parameter Details

<attach>

Attach the classpath file to the main artifact so it can be installed and deployed.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • Default: false

<classifier>

Specify classifier to look for. Example: sources
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: classifier

<excludeArtifactIds>

Comma separated list of Artifact names to exclude.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: excludeArtifactIds

<excludeClassifiers>

Comma Separated list of Classifiers to exclude. Empty String indicates don't exclude anything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: excludeClassifiers

<excludeGroupIds>

Comma separated list of GroupId Names to exclude.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: excludeGroupIds

<excludeScope>

Scope threshold to exclude, if no value is defined for include. An empty string indicates no dependencies (default).
The scope threshold value being interpreted is the scope as Maven filters for creating a classpath, not as specified in the pom. In summary:
  • runtime exclude scope excludes runtime and compile dependencies,
  • compile exclude scope excludes compile, provided, and system dependencies,
  • test exclude scope excludes all dependencies, then not really a legitimate option: it will fail, you probably meant to configure includeScope = compile
  • provided exclude scope just excludes provided dependencies,
  • system exclude scope just excludes system dependencies.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: excludeScope

<excludeTransitive>

If we should exclude transitive dependencies
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: excludeTransitive
  • Default: false

<excludeTypes>

Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: excludeTypes

<fileSeparator>

Override the char used between the paths. This field is initialized to contain the first character of the value of the system property file.separator. On UNIX systems the value of this field is '/'; on Microsoft Windows systems it is '\'. The default is File.separator
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: mdep.fileSeparator

<includeArtifactIds>

Comma separated list of Artifact names to include. Empty String indicates include everything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: includeArtifactIds

<includeClassifiers>

Comma Separated list of Classifiers to include. Empty String indicates include everything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: includeClassifiers

<includeGroupIds>

Comma separated list of GroupIds to include. Empty String indicates include everything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: includeGroupIds

<includeScope>

Scope threshold to include. An empty string indicates include all dependencies (default).
The scope threshold value being interpreted is the scope as Maven filters for creating a classpath, not as specified in the pom. In summary:
  • runtime include scope gives runtime and compile dependencies,
  • compile include scope gives compile, provided, and system dependencies,
  • test include scope gives all dependencies (equivalent to default),
  • provided include scope just gives provided dependencies,
  • system include scope just gives system dependencies.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: includeScope

<includeTypes>

Comma Separated list of Types to include. Empty String indicates include everything (default).
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: includeTypes

<localRepoProperty>

Replace the absolute path to the local repo with this property. This field is ignored it prefix is declared. The value will be forced to "${M2_REPO}" if no value is provided AND the attach flag is true.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: mdep.localRepoProperty

<markersDirectory>

Directory to store flag files
  • Type: java.io.File
  • Since: 2.0
  • Required: No
  • User Property: markersDirectory
  • Default: ${project.build.directory}/dependency-maven-plugin-markers

<outputAbsoluteArtifactFilename>

Output absolute filename for resolved artifacts
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: outputAbsoluteArtifactFilename
  • Default: false

<outputEncoding>

(no description)
  • Type: java.lang.String
  • Required: No
  • User Property: outputEncoding
  • Default: ${project.reporting.outputEncoding}

<outputFile>

The file to write the classpath string. If undefined, it just prints the classpath as [INFO].
  • Type: java.io.File
  • Required: No
  • User Property: mdep.outputFile

<outputFilterFile>

Write out the classpath in a format compatible with filtering (classpath=xxxxx)
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: mdep.outputFilterFile
  • Default: false

<outputProperty>

A property to set to the content of the classpath string.
  • Type: java.lang.String
  • Required: No
  • User Property: mdep.outputProperty

<overWriteIfNewer>

Overwrite artifacts that don't exist or are older than the source.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: overWriteIfNewer
  • Default: true

<overWriteReleases>

Overwrite release artifacts
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: overWriteReleases
  • Default: false

<overWriteSnapshots>

Overwrite snapshot artifacts
  • Type: boolean
  • Since: 1.0
  • Required: No
  • User Property: overWriteSnapshots
  • Default: false

<pathSeparator>

Override the char used between path folders. The system-dependent path-separator character. This field is initialized to contain the first character of the value of the system property path.separator. This character is used to separate filenames in a sequence of files given as a path list. On UNIX systems, this character is ':'; on Microsoft Windows systems it is ';'.
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: mdep.pathSeparator

<prefix>

The prefix to prepend on each dependent artifact. If undefined, the paths refer to the actual files store in the local repository (the stripVersion parameter does nothing then).
  • Type: java.lang.String
  • Required: No
  • User Property: mdep.prefix

<prependGroupId>

Prepend the groupId during copy.
  • Type: boolean
  • Since: 2.2
  • Required: No
  • User Property: mdep.prependGroupId
  • Default: false

<regenerateFile>

If 'true', it skips the up-to-date-check, and always regenerates the classpath file.
  • Type: boolean
  • Required: No
  • User Property: mdep.regenerateFile
  • Default: false

<silent>

If the plugin should be silent.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: silent
  • Default: false

<skip>

Skip plugin execution completely.
  • Type: boolean
  • Since: 2.7
  • Required: No
  • User Property: mdep.skip
  • Default: false

<skipDuringIncrementalBuild>

Skip plugin execution only during incremental builds (e.g. triggered from M2E).
See also: org.apache.maven.plugins.dependency.AbstractDependencyMojo.skip
  • Type: boolean
  • Since: 3.4.0
  • Required: No
  • Default: false

<stripClassifier>

Strip artifact classifier during copy (only works if prefix is set)
  • Type: boolean
  • Required: No
  • User Property: mdep.stripClassifier
  • Default: false

<stripVersion>

Strip artifact version during copy (only works if prefix is set)
  • Type: boolean
  • Required: No
  • User Property: mdep.stripVersion
  • Default: false

<type>

Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war
  • Type: java.lang.String
  • Since: 2.0
  • Required: No
  • User Property: type

<useBaseVersion>

Either append the artifact's baseVersion or uniqueVersion to the filename. Will only be used if isStripVersion() is false.
  • Type: boolean
  • Since: 2.6
  • Required: No
  • User Property: mdep.useBaseVersion
  • Default: true