Questions tagged [maven-dependency-plugin]

The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.

The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.

When using the Maven Dependency Plugin, it is recommended to keep in mind the Maven Dependency Mediation mechanism, what Maven coordinates are and how Maven dependencies are declared and handled.

More information

420 questions
4
votes
1 answer

How can I download a ZIP file with the Maven dependency plugin?

I'm trying to download a couple of dependencies from the command line using dependency:copy -Dartifact=... However, one artifact looks like this as dependency foo xml-schemas
eerriicc
  • 1,124
  • 4
  • 17
  • 29
4
votes
2 answers

Can I use wildcards to include/exclude a groupID from the maven dependency plugin's unpack-dependencies goal?

I have a project where some of the dependencies have a secondary artifact that I would like to collect & unpack when making my distribution. By using the type and classifier parameters I was able to find these secondary artifacts, which is…
carej
  • 596
  • 1
  • 6
  • 18
3
votes
1 answer

maven-dependency-plugin unpack not being executed during phase

I'm packaging an ejb and I need to include some .classes from a dependency into the jar, I'm trying to use the maven-dependency-plugin to unpack the artifact and put the files in my ${project.build.directory}/classes directory during the package…
davidmontoyago
  • 1,834
  • 14
  • 18
3
votes
1 answer

Include unzipped resource in JAR - Maven

I have a versioned ZIP file deployed in my artifact repository that I need to download, extract, and include as a resource with Maven. I have been successful using the maven-dependency-plugin to retrieve the artifact and extract it during the…
3
votes
1 answer

Maven Dependency Plugin: usedDependency vs. ignoredUnusedDeclaredDependencies

What is the difference between the maven-dependency-plugin's ignoredUnusedDeclaredDependencies and usedDependencies? I have several runtime/test-runtime dependencies that are flagged by the plugin as unused and declared and would like to ignore…
shelley
  • 7,206
  • 4
  • 36
  • 63
3
votes
0 answers

How can I solve the Maven error distributionManagement.status must not be specified

I'm trying to download the maven-appassembler-plugin and all its dependencies to use offline. I'm running the command: mvn org.apache.maven.plugins:maven-dependency-plugin:3.1.1:copy -Dartifact=org.codehaus.mojo:appassembler-maven-plugin:1.10 and…
Eyal Azran
  • 379
  • 1
  • 3
  • 14
3
votes
0 answers

Use Maven dependency with special characters in artifactId

I want to add a Maven dependency that's hosted on the JitPack repository. The artifactId contains dots and, therefore, cannot be downloaded due to issues within JitPack's infrastructure. The workaround is to replace . with ~. But Maven forbids the…
mike
  • 4,929
  • 4
  • 40
  • 80
3
votes
0 answers

Why is Maven persisting corrupt dependency jars in local repository in a multi-threaded build?

I'm running into following error frequently [BuilderThread 4] [WARNING] error reading /opt/jenkins/maven-repositories/0/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar; zip file is empty The missing/corrupt jar…
phanin
  • 5,327
  • 5
  • 32
  • 50
3
votes
1 answer

How to make Maven download only the POM files for all (transitive) dependencies?

I'm currently using the maven-dependency-plugin like mvn -B dependency:copy-dependencies \ -Dmdep.copyPom=true \ -DoutputDirectory="$OUTDIR" to download all POMs of all (transitive) dependencies. However, that is also downloading the JARs,…
sschuberth
  • 28,386
  • 6
  • 101
  • 146
3
votes
1 answer

maven-dependency-plugin analyze - "Skipping project with no build directory"

I'm running mvn dependency:analyze-only & im getting the error below. Can someone point me to the correct config for running the maven dependency analyzer?. FYI, my project builds fine with maven, so im not sure what its looking for. I also…
Mr Smith
  • 3,318
  • 9
  • 47
  • 85
3
votes
1 answer

Which formats can the dependencies:unpack-dependencies goal unpack?

Which archive formats can dependencies:unpack-dependencies unpack? For instance, as far as I see it can't unpack RPM packages. Is there a list of formats it supports available somewhere? Is there some trick with which I can make maven unpack RPM…
3
votes
2 answers

Maven-Dependency-Plugin: NoSuchElementException for Aether RepositorySystem

I keep seeing a NoSuchElementException for the tag in the maven-dependency-plugin. I have tried adding dependencies for aether-spi, aether-api, and aether-util to my pom.xml but the error does not go away. I can sometimes get it to go away if I…
jencoston
  • 1,262
  • 7
  • 19
  • 35
3
votes
4 answers

What is the best way to manage project dependencies

I have following dependency hierarchy in a service: Service A -> Lib A -> Lib B -> Lib A -> Lib C -> Lib A -> Lib D -> Lib A "->" means depends on. There are lot of problems that pops up because of above structure.…
Atul
  • 1,694
  • 4
  • 21
  • 30
3
votes
2 answers

Maven maven-dependency-plugin copy-dependencies ignores outputDirectory

I'm try to use the maven-dependency-plugin's copy-dependencies goal. I checked its official example with the snippet below. My problem is: the dependencies are always copied to target\dependency folder, even if I specify an
zsom
  • 479
  • 1
  • 5
  • 19
3
votes
1 answer

Maven Dependency Plugin: Copy only test dependencies

I have already assembled all runtime dependencies for my project in one output directory using the Maven Dependency plugin. Now I would like to assemble all additional test dependencies in a separate directory. But when I include scope test and…
Carsten
  • 1,248
  • 9
  • 15