dependency:copy-dependencies

Full name:

org.apache.maven.plugins:maven-dependency-plugin:3.9.0:copy-dependencies

Description:

Goal that copies the files for a project's dependencies from the repository to a directory. The default location to copy to is target/dependencies. Since all files are copied to the same directory by default, a dependency that has the same file name as another dependency will be overwritten.

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: 1.0.
  • Binds by default to the lifecycle phase: process-sources.

Optional Parameters

Name Type Since Description
<addParentPoms> boolean 2.8 Add parent poms to the list of copied dependencies (both current project pom parents and dependencies parents).
Default: false
User Property: mdep.addParentPoms
<classifier> String 2.0 Specify classifier to look for. Example: sources.
User Property: classifier
<copyPom> boolean 2.0 Also copy the pom of each artifact.
Default: false
User Property: mdep.copyPom
<copySignatures> boolean 3.2.0 Also copy the signature files (.asc) of each artifact.
Default: false
User Property: mdep.copySignatures
<excludeArtifactIds> String 2.0 Comma-separated list of artifact IDs to exclude.
User Property: excludeArtifactIds
<excludeClassifiers> String 2.0 Comma-separated list of Classifiers to exclude. Empty String indicates don't exclude anything (default).
User Property: excludeClassifiers
<excludeGroupIds> String 2.0 Comma-separated list of group IDs to exclude.
User Property: excludeGroupIds
<excludeScope> String 2.0 Scope threshold to exclude, if no value is defined for include. An empty string indicates no dependencies (default). Unlike the other exclusion parameters, this property does not support a comma-delimited list of scope exclusions. Just one scope may be excluded at a time.
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: excludeScope
<excludeTransitive> boolean 2.0 If we should exclude transitive dependencies.
Default: false
User Property: excludeTransitive
<excludeTypes> String 2.0 Comma-separated list of Types to exclude. Empty String indicates don't exclude anything (default).
User Property: excludeTypes
<failOnMissingClassifierArtifact> boolean 2.0-alpha-2 This only applies if the classifier parameter is used.
Default: false
User Property: mdep.failOnMissingClassifierArtifact
<includeArtifactIds> String 2.0 Comma-separated list of artifact IDs to include. Empty String indicates include everything (default).
User Property: includeArtifactIds
<includeClassifiers> String 2.0 Comma-separated list of Classifiers to include. Empty string indicates include everything (default).
User Property: includeClassifiers
<includeGroupIds> String 2.0 Comma-separated list of group IDs to include. Empty string indicates include everything (default).
User Property: 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: includeScope
<includeTypes> String 2.0 Comma-separated list of Types to include. Empty String indicates include everything (default).
User Property: includeTypes
<markersDirectory> File 2.0 Directory to store flag files.
Default: ${project.build.directory}/dependency-maven-plugin-markers
User Property: markersDirectory
<outputDirectory> File 1.0 Output location.
Default: ${project.build.directory}/dependency
User Property: outputDirectory
<overWriteIfNewer> boolean 2.0 Overwrite artifacts that don't exist or are older than the source.
Default: true
User Property: overWriteIfNewer
<overWriteReleases> boolean 1.0 Overwrite release artifacts.
Default: false
User Property: overWriteReleases
<overWriteSnapshots> boolean 1.0 Overwrite snapshot artifacts.
Default: false
User Property: overWriteSnapshots
<prependGroupId> boolean 2.2 Prepend the group ID during copy.
Default: false
User Property: mdep.prependGroupId
<silent> boolean 2.0
Deprecated.
to be removed in 4.0; use -q command line option instead

If the plugin should be silent.
Default: false
User Property: silent
<skip> boolean 2.7 Skip plugin execution completely.
Default: false
User Property: 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: false
<stripClassifier> boolean - Strip artifact classifier during copy.
Default: false
User Property: mdep.stripClassifier
<stripType> boolean 3.4.0 Strip artifact type during copy.
Default: false
User Property: mdep.stripType
<stripVersion> boolean - Strip artifact version during copy.
Default: false
User Property: mdep.stripVersion
<type> String 2.0 Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war.
User Property: 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: true
User Property: mdep.useBaseVersion
<useRepositoryLayout> boolean 2.0-alpha-2

Place each artifact in the same directory layout as a default repository.

example:

  /outputDirectory/junit/junit/3.8.1/junit-3.8.1.jar

Default: false
User Property: mdep.useRepositoryLayout
<useSubDirectoryPerArtifact> boolean 2.0-alpha-1 Place each file in a separate subdirectory. (example /outputDirectory/junit-3.8.1-jar)
Default: false
User Property: mdep.useSubDirectoryPerArtifact
<useSubDirectoryPerScope> boolean 2.2 Place each type of file in a separate subdirectory. (example /outputDirectory/runtime /outputDirectory/provided etc.)
Default: false
User Property: mdep.useSubDirectoryPerScope
<useSubDirectoryPerType> boolean 2.0-alpha-1 Place each type of file in a separate subdirectory. (example /outputDirectory/jars /outputDirectory/wars etc.)
Default: false
User Property: mdep.useSubDirectoryPerType

Parameter Details

<addParentPoms>

Add parent poms to the list of copied dependencies (both current project pom parents and dependencies parents).
  • Type: boolean
  • Since: 2.8
  • Required: No
  • User Property: mdep.addParentPoms
  • Default: false

<classifier>

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

<copyPom>

Also copy the pom of each artifact.
  • Type: boolean
  • Since: 2.0
  • Required: No
  • User Property: mdep.copyPom
  • Default: false

<copySignatures>

Also copy the signature files (.asc) of each artifact.
  • Type: boolean
  • Since: 3.2.0
  • Required: No
  • User Property: mdep.copySignatures
  • Default: false

<excludeArtifactIds>

Comma-separated list of artifact IDs 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 group IDs 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). Unlike the other exclusion parameters, this property does not support a comma-delimited list of scope exclusions. Just one scope may be excluded at a time.
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

<failOnMissingClassifierArtifact>

This only applies if the classifier parameter is used.
  • Type: boolean
  • Since: 2.0-alpha-2
  • Required: No
  • User Property: mdep.failOnMissingClassifierArtifact
  • Default: false

<includeArtifactIds>

Comma-separated list of artifact IDs 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 group IDs 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

<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

<outputDirectory>

Output location.
  • Type: java.io.File
  • Since: 1.0
  • Required: No
  • User Property: outputDirectory
  • Default: ${project.build.directory}/dependency

<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

<prependGroupId>

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

<silent>

Deprecated.
to be removed in 4.0; use -q command line option instead

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.
  • Type: boolean
  • Required: No
  • User Property: mdep.stripClassifier
  • Default: false

<stripType>

Strip artifact type during copy.
  • Type: boolean
  • Since: 3.4.0
  • Required: No
  • User Property: mdep.stripType
  • Default: false

<stripVersion>

Strip artifact version during copy.
  • 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

<useRepositoryLayout>

Place each artifact in the same directory layout as a default repository.

example:

  /outputDirectory/junit/junit/3.8.1/junit-3.8.1.jar
  • Type: boolean
  • Since: 2.0-alpha-2
  • Required: No
  • User Property: mdep.useRepositoryLayout
  • Default: false

<useSubDirectoryPerArtifact>

Place each file in a separate subdirectory. (example /outputDirectory/junit-3.8.1-jar)
  • Type: boolean
  • Since: 2.0-alpha-1
  • Required: No
  • User Property: mdep.useSubDirectoryPerArtifact
  • Default: false

<useSubDirectoryPerScope>

Place each type of file in a separate subdirectory. (example /outputDirectory/runtime /outputDirectory/provided etc.)
  • Type: boolean
  • Since: 2.2
  • Required: No
  • User Property: mdep.useSubDirectoryPerScope
  • Default: false

<useSubDirectoryPerType>

Place each type of file in a separate subdirectory. (example /outputDirectory/jars /outputDirectory/wars etc.)
  • Type: boolean
  • Since: 2.0-alpha-1
  • Required: No
  • User Property: mdep.useSubDirectoryPerType
  • Default: false