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
7
votes
1 answer

How can I use dependencies of a project that's been marked as provided?

I have the following scenario, simplified: projectX ---> projectA ---> projectB Where ---> means "depends on". ProjectB is really simple. It doesn't declare any dependenci. In fact, the only relevant part is this: jar In…
Luiggi Mendoza
  • 85,076
  • 16
  • 154
  • 332
6
votes
1 answer

Use pom-packaging maven project as dependency

I'm consulting a question on using pom-packaging maven project as dependency in another project. I tried reading the documentation of maven and searching online, but I found few solution. The pom-packaging project consists of multiple submodules…
Haoran.Luo
  • 113
  • 1
  • 6
5
votes
1 answer

Cannot generate JPA Hibernate Metamodel classes in IntelliJ IDEA

In my Java project, I get "java: cannot find symbol" errors pointing Metamodel classes e.g. Company_. So, first I checked my-project\target\generated-sources\annotations and see that it is empty. Then, after several search on the web and SO, I see…
user17186249
5
votes
0 answers

Set Up Google Maven Dependencies For Use Offline

I'm just trying to set up the Google Maven dependencies that I downloaded from: https://d.android.com/r/studio-offline/downloads I followed the "README" instructions and then tried to verify everything was working by commenting out jcenter() and…
5
votes
1 answer

Maven : How to use local lib directory for dependencies instead of maven respoitories

My project structure as below during the integration test. Project-A |_conf (contains the configuration files) |_lib (Contains the all dependencies) |_pom.xml |_target |_test (Contains the integration tests) When I run the…
sree1611
  • 352
  • 1
  • 4
  • 18
5
votes
1 answer

Should you include those dependencies in your pom that are already the dependencies of some of your dependencies?

Say there are two dependencies you need: A and B. And at the same time A is already a dependency of B. So do you still want/need to add A along with B as dependencies in your pom? I believe this may be needed when A and B are external libraries…
user1589188
  • 5,316
  • 17
  • 67
  • 130
5
votes
2 answers

Export maven as jar file with all dependencies

I have my own java library created as maven project and has some dependencies included in pom.xml I want to export project as jar and include it into others maven projects. The problem is that I need to copy all dependencies from pom.xml of my…
KunLun
  • 3,109
  • 3
  • 18
  • 65
5
votes
3 answers

java.lang.NoClassDefFoundError: Could not initialize class com.datastax.driver.core.Cluster

I have a maven project A pom.xml for the project A : com.app.cops cassandra-logging 0.0.1-SNAPSHOT
Prasad Shinde
  • 652
  • 2
  • 8
  • 21
4
votes
1 answer

In a multi-module maven project, can I make a module to calculate transitive dependencies based on the DependencyReducedPom of another module?

This appears to be a simple question but I found it difficult due to maven's extremely rigorous paradigm of lifecycles and phases: Assuming that in a multi-module maven project, several plugins are used in various phases to rewrite the pom.xml to…
4
votes
3 answers

The POM for com.sun.xml.ws:jaxws-rt:pom:2.2.10 is invalid

I am facing strange problem during build of our project. The problem boils down probably to dependency on jaxws-rt 2.2.10. The main problem is this warning which stops transitive dependencies to propagate to our distibutable. The POM for…
Zveratko
  • 2,663
  • 6
  • 35
  • 64
4
votes
2 answers

classNotFound error by maven?

I am learning maven but I am facing problem in importing dependencies, following is my pom.xml file
AviatorX
  • 492
  • 1
  • 7
  • 17
4
votes
1 answer

How to exclude a dependecy only for test scope in java

I want to exclude a dependency only for test scope. Example:- commons-lang3 dependency is used in two different places in my project. I want to exclude this dependency for test scope only. org.apache.commons
Galet
  • 5,853
  • 21
  • 82
  • 148
4
votes
1 answer

SpringBootTest cannot be resolved to a type

I have a simple Spring Boot project. I'm using maven for dependency management. The import for SpringBootTest is not recognised so I'm getting: SpringBootTest cannot be resolved to a type I can't figure out what the problem is with this. Here's…
Natasha
  • 1,470
  • 5
  • 18
  • 24
4
votes
2 answers

How to check maven dependency compatibility

I'm trying to figure out if it is possible to check whether a maven dependency is still compatible in the configured configuration of a project. Here is my Test setup: There are 3 projects. Child-A, Child-B, Child-C. Child-A is available in 2…
4
votes
2 answers

Maven Integration with Query DSL

I am trying to integrate an existing project in maven with query dsl I have added the dependencies as below ` com.mysema.querydsl querydsl-apt 2.5.0
Rudy
  • 679
  • 2
  • 9
  • 17
1
2
3
14 15