Questions tagged [maven-dependency]

A dependency in Maven is a required external library the project depends upon to build and run correctly.

A dependency in Maven is a required external library the project depends upon to build and run correctly. In Maven, dependencies are declared via GAV coordinates (Group id, Artifact id, Version), they could also optionally have a scope, a classifier, a type.

An example of dependency:

<dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.11</version>
   <scope>test</scope>
</dependency>

Check the official Maven quick-start guide on how to use external dependencies for a first look at it.

More Info

224 questions
2
votes
1 answer

maven avoid downloading dependency

We have product help document which is about 150Mb and being build every day and updated to maven repo. So when we build the project which has dependency on help document it will download entire 150Mb once everyday and it takes lot of time. Is…
Dheeraj Joshi
  • 3,057
  • 8
  • 38
  • 55
2
votes
2 answers

Dependency Convergence error for powermock

I want to use the last version of the powermock library (1.6.5) through Maven. But My package cannot be compiled, since Maven finds dependency Convergence error. Below you can see that there are 2 different versions of org.objenesis:objenesis…
user2957954
  • 1,221
  • 2
  • 18
  • 39
2
votes
1 answer

Proper dependency scope for javadoc links only

I want to add a dependency to a project solely for referencing them in Javadocs, like {@link some.class.from.dependency.Foo#bar()}. What scope I should better use for such dependencies: optional or provided? Or I still need compile?
leventov
  • 14,760
  • 11
  • 69
  • 98
2
votes
2 answers

Maven dependency to apache commons-text?

I would like to include a Maven dependency on the apache commons-text project. I tried adding this dependency to my pom: org.apache.commons commons-text
Sergio
  • 8,532
  • 11
  • 52
  • 94
2
votes
1 answer

How can I find out hidden versions of dependencies and plugins in Maven?

We do not need to specify the versions and other parameters of Maven dependencies and plugins we use. We can do it only once in parent POM or may be in some other way and inherit that properties in our children POMs. Unfortunately for many times I…
MiamiBeach
  • 3,261
  • 6
  • 28
  • 54
1
vote
1 answer

Maven downloads all dependencies again because they were "cached from a remote repository ID that is unavailable in current build context"

I have a multi-staged Docker build. In step one, I download and cache all dependencies (I use the Maven goal package for this). This is Docker layer is the base for all future build steps. In step two, I build the project. However, in step two, all…
Harold L. Brown
  • 8,423
  • 11
  • 57
  • 109
1
vote
1 answer

JavaFX with Maven fails to import module from the same project

I have the following folder structure in a Java project: main-module (Java module) sub-module-to-import (Java module) ImportedClass.java sub-module (Java module) fx-sub-module (JavaFX module) - pom.xml and…
Yoan
  • 15
  • 5
1
vote
0 answers

Why doesn't maven see a specific version of the dependency?

I have a separate project, which I assemble into a jar file, and connect as an external dependency to my main project. External project…
Santa Monica
  • 332
  • 3
  • 11
1
vote
2 answers

maven dependency plugin throwing error even if I add flag ignoreunuseddeclareddependecy

I am trying to build my code and I am getting this error: [WARNING] Unused declared dependencies found: [WARNING] com:test-client:jar:v1.0-SNAPSHOT:compile This is the configuration of the dependency plugin in my pom:
1
vote
1 answer

dependency is packaged with provided scope in spring boot

I want to package the spring boot jar without the javafaker dependency. I am using the Javafaker dependency and want it to be loaded only during dev time. com.github.javafaker javafaker
zilcuanu
  • 3,451
  • 8
  • 52
  • 105
1
vote
1 answer

Missing artifact error and The container 'Maven Dependencies' references non existing library

I start a new project in Maven and I had some code while searching for dependencies ,I get this error/message "Missing artifact com.google.common:google-collect:jar:1.0-rc1" and this in the code how to solve it ? I found an answer
Vladi
  • 1,662
  • 19
  • 30
1
vote
1 answer

Resolve Local Maven Project as Dependency in Jenkins

I have two maven Projects call them as MainProject and DependnecyProject. I use DependnecyProject functions in the MainProject project which means DependnecyProject is a dependency for MainProject Project. MainProject pom.xml
Pratap
  • 63
  • 4
1
vote
1 answer

MongoDB java driver latest version(4.1.0) not available in maven repo

The latest mongo db driver version is not available in maven rep. Is it usual or expected. Mongo DB driver Release notes: https://github.com/mongodb/mongo-java-driver/releases Maven repo URL:…
mperle
  • 3,342
  • 8
  • 20
  • 34
1
vote
2 answers

Maven - Add a maven module as dependency to other maven module

I have 2 Spring boot maven projects(module A, Module B). And they both are added as modules to a parent project. Both Modules have some common dependencies and java classes(Domain objects), so I created third module Module C, and placed all the…
Rajesh2389
  • 349
  • 2
  • 15
1
vote
0 answers

Finding archived maven artifacts when using internal repository

Maven is used in Java projects as a dependency manager. There's Artifactory acting as internal repository and caching proxy for Maven central repository. All maven projects are configured to use it as repository and plugin-repository in their…
rok
  • 9,403
  • 17
  • 70
  • 126