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

ClassNotFoundException for Dependency in Velocity Minecraft Plugin

I'm currently developing a Velocity Minecraft plugin, and I'm encountering a ClassNotFoundException for FileUtils from org.apache.commons.io.FileUtils, even though I have added the library to my project's dependencies in the pom.xml file. All…
0
votes
2 answers

How do I detect which dependencies and which libraries in the project are used or which are not?

Some 3rd party libraries and dependencies are obsolete or outdated in my Maven project. How do I detect which ones are used and which are not? How do I update outdated ones? I want the unused ones to be deleted and the outdated ones to be updated.
0
votes
0 answers

Maven internal dependency issues (non-syntactical error)

I am kind of new to maven. And I watched a couple youtube videos to start with a quick maven archetype in VS code. I am working with python and java which requires me to use common code editors. But as of now I am working on java seperately to merge…
0
votes
0 answers

Maven dependency tree command not working

mvn dependency:tree is always trying to download the maven-plugins one by one and it fails at the end. I am not able to see the dependency tree. I have run mvn clean install before running mvn…
Eli Johnes
  • 301
  • 3
  • 13
0
votes
0 answers

Why am I getting an "Unable to initialize main class" error when running "java -jar Macroffects-0.2.0-SNAPSHOT.jar"?

I have a working java program that I would like to turn into a .jar and eventually a .exe. I am using maven in VS Code on a mac. Initially, I was getting the "no main manifest attribute" error, which I resolved by adding "Main-Class:…
0
votes
0 answers

The type java.io.File cannot be resolved. It is indirectly referenced from required type org.assertj.core.api.Assertions

folder: src/test/java @AutoConfigureTestDatabase(replace = Replace.NONE) Under Replace.NONE, i am having error as follows: The type java.io.File cannot be resolved. It is indirectly referenced from required type org.assertj.core.api.Assertions I…
0
votes
0 answers

Maven dependency version detection

I am using Maven in my project. I see below dependency is mentioned in one of the module's pom.xml without version. com.graphql-java graphql-java I see that in…
Lolly
  • 34,250
  • 42
  • 115
  • 150
0
votes
0 answers

Having issues with MVN Version command showing versions already updated

I am updating my maven dependencies. I ran "mvn versions:display-dependency-updates" in terminal and i receive the dependencies that have newer versions. Example: [INFO] io.projectreactor:reactor-test........3.4.28->3.5.4 [INFO]…
Eddy
  • 75
  • 7
0
votes
0 answers

maven Exception in thread "main" java.lang.NoClassDefFoundError when I try to run the application

Build using mvn package is successful. I am able to find dependencies in .m2 repository. But when I try to run using java -jar myjar.jar in Intellij idea or cmd, I get Exception in thread "main" java.lang.NoClassDefFoundError Whatever dependency I…
0
votes
0 answers

Doesn't work second-level cache in Hibernate app

I'm trying to connect and test the second level cache in the hibernate application. It seems like I managed to connect the necessary dependencies and set up the config file. But the cache itself does not work when checking, the new session makes a…
0
votes
0 answers

Which plugin can copy classes from specific dependency into final jar

I created a maven parent project, where I have: Parent pom: my-project-solution-a my-project-solution-b my-project-shared-solution my-project-shared-solution…
victorio
  • 6,224
  • 24
  • 77
  • 113
0
votes
2 answers

List all available versions of a dependency

I would like to list all available versions of a given dependency. The reason: When a vulnerability is found, the dependency gets blocked by a mechanism we built upon JFrog Xray. I want to generate a list of dependencies which are still unblocked. I…
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
0
votes
0 answers

Maven dependency: difference between a compile dependencies Version and Updates Column?

Lets say for example I need two dependencies A and B. Dependency A uses dependency B version 1.2 and the update column lists say 4.2, In my pom I declared The version of B to be say 1.1, Would this cause a dependency issue? Now lets say the version…
0
votes
1 answer

How to upload Maven dependencies to Artifactory

I installed Artifactory and now I want to use a local repo to store maven dependencies that'll be used during the build. How can the dependencies be uploaded, please note the server is not connected to internet. How will the dependencies be uploaded…
Hangul
  • 19
  • 1
  • 3
0
votes
0 answers

maven dependency tree not updated even after changing dependency version

maven dependency tree not updated even after changing dependency version added org.apache.tomcat tomcat-jdbc