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
2
votes
2 answers

Maven: Cannot resolve property in pom.xml

I just started converting my Android Project into Maven. I'm trying to use properties in my pom.xml but I'm getting the error: Dependency com.google.android:android${android.version} not found I'm also getting the same errors for the other…
dannyroa
  • 5,501
  • 6
  • 41
  • 59
2
votes
1 answer

The goal "copy-dependencies" does not copy the parent pom

My project structure is like this: * Foo - API - Core - OSGi All child projects define Foo as their parent (parent has dependencyManagement). Another team is going to use my project. They only need my API layer and they cannot access my maven…
Pigelvy
  • 606
  • 6
  • 17
2
votes
2 answers

How to stop Maven from overwriting if the destination exists

I have a directory in a dependency, that I want copied in src/main/webapp/mypath during the initialize phase. But I want it to be copied exactly and only once, meaning that: if src/main/webapp/mypath doesn't exist, then copy from dependency if…
2
votes
1 answer

Maven is not downloading , correct version jar

I am new to maven & stuck with a problem . My project is getting build with maven , but its downloading different version jar ( Spring core 2.5.6.SEC03.jar) , although i have specified 3.1.1 version in POM.xml. Does Maven refer any other…
2
votes
1 answer

Getting a deployed jar-with-dependencies without the transitive dependencies

I'm using the maven-assembly-plugin to create a jar file that contains all of the dependencies needed to run my app. The configuration for the assembly uses a descriptorRef that points to my custom assembly. When I look in the maven repository, I…
VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91
2
votes
1 answer

copy dependencies transitive and not transitive

In a pom.xml (jar packaging) i want to make use of the maven dependency plugin to download two kinds of dependencies. One kind i want to be downloaded with transitives and one without. Up to now, my plugins section contains follwing…
Matthias
  • 3,458
  • 4
  • 27
  • 46
2
votes
2 answers

What is Maven dependency:purge-local-repository supposed to do?

I'm trying to purge the local repository of a project dependency before launching releasing it in order to make sure every dependency required is on the central repository and is downloaded from it. In the project folder (containing the pom.xml), I…
Florent Paillard
  • 549
  • 1
  • 6
  • 20
1
vote
1 answer

In Maven how can I generate a classpath file that includes the artifact I'm building?

I'm using maven-dependency-plugin:build-classpath to build a classpath file. To support a legacy deployment, I need this file to include the artifact I'm building, in addition to the usual set of dependency JARs. Current classpath…
Chris Beach
  • 4,302
  • 2
  • 31
  • 50
1
vote
2 answers

How to download Java source for a Maven artifact and its dependencies from the CLI (not in project directory)?

Note: maven-dependency-plugin isn't suitable here for reasons specified below I'm deploying projects to Artifactory with sources attached. I'd like to be able to run a command to download and unpack sources for a given artifact and its dependencies.…
Chris Beach
  • 4,302
  • 2
  • 31
  • 50
1
vote
1 answer

Maven plugin artifact filter unimportant dependencies

I'm developing a Maven plugin and using the MavenProject object to access my dependencies with project.getDependencyArtifacts(), but this gives my all jar, even the test only jars. Is there some method to filter all non runtime jar? If I just get…
Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
1
vote
2 answers

How can I strip the version from the output directory of maven-dependency-plugin:unpack?

I need to unpack an artifact, and I need to use it's unpacked location in several places (in multiple files). I don't want to have to update all the copies of that location every time I change versions. Is there a way I can strip the version from…
Jared
  • 1,887
  • 3
  • 20
  • 45
1
vote
2 answers

Maven Command Dependencies

I am trying to execute "mvn license:add-third-part" on a server, that is not connected to the web. It's missing some dependencies. I tried to add them manually, but it says that still some transitive dependencies are missing. I there a way to…
Torben
  • 13
  • 3
1
vote
1 answer

The POM for org.json:json:jar:20210118 is missing, no dependency information available

I am adding jar dependency in pom.xml file in maven project org.json json 20210118 but i got error: The POM for org.json:json:jar:20210118 is…
1
vote
1 answer

mvn go-offline trying to download dependencies not in dependency tree

I have a maven build that fails on executing mvn go-offline, because it tries to download log4j-core:2.11.2 - a version which has been removed from my company's Artifactory due to the Log4Shell vulnerability. But I can't figure out why my project…
1
vote
2 answers

Unable to get the auto-suggestion for annotations for springframework inspite of using the dependency

I have create a spring project from spring initializer and have imported it to IntelliJ, have included the Web dependency while creation but i am not getting the auto suggestions for annotations though pom.xml has the dependency for it. …