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

During maven deployment through gitlab ci/cd, some dependency transform times vary wildly

I used the -X flag on mvn deploy to see why our maven deployment lengths could very between 5 and 30 minutes. What I have found is that dependency collection stats for our various submodules varies wildly between a few seconds and, say, 15 minutes.…
Jeremy
  • 5,365
  • 14
  • 51
  • 80
0
votes
1 answer

Avoid maven cyclic dependency with scope test

I have the next problem. "A" library contains custom JSF components. "B" library contains Selenium tests for these custom components, and some others (Primefaces JSF components). When I develop "A", I want to test any change using "B" in order to…
0
votes
0 answers

Maven build passes in command line but Intellij shows errors

I have a maven multi-module project . In the parent module there is a certain dependency which is mentioned in dependencyManagement-> dependencies section say x. Now in one of the child modules , few classes belonging to artifact x are being…
Rajeev Akotkar
  • 1,377
  • 4
  • 26
  • 46
0
votes
1 answer

How do I add a Maven dependency in VS Code for a simple Java project (i.e. an unmanaged folder without any build tools)?

I'm trying to build an AI model for the Mario-AI-Framework using the Deep Java Library (DJL). I'm using VS Code with the Java extension, as this is part of a larger project, mainly in Python. Now I have a Pytorch model trained and ready to go but I…
0
votes
2 answers

Maven downloads the wrong version

I specified dependency version 75.1.3 in my pom.xml pointing to one of my other projects: 75.1.3
RotS
  • 2,142
  • 2
  • 24
  • 30
0
votes
1 answer

A question about best practice on multiple dependency jar versions when packing war with maven

I have a maven war project with submodules. One module uses google-api-client, another use google-cloud-storage. I draw some of their dependencies below A |-google-api-client:jar:1.33.1 …
Harper
  • 1,794
  • 14
  • 31
0
votes
1 answer

Getting errors after attempting to update log4j and remove display tag

I've recently had to update my log4j dependency as the old one was being pulled in by displaytag. I've converted all of the necessary tables, and things seem to be running fine on the front end, but I'm receiving the following error in the…
0
votes
0 answers

Maven build failure unable to generate war file

[enter image description here][1]Hi Team, I'm getting error while trying to build war file maven failure in jenkins can anyone help me how can I resolve the issue [1]: https://i.stack.imgur.com/d2esu.jpg![enter image description…
Shaik
  • 1
0
votes
0 answers

Maven keeps downloading newer version of dependency

I have a library named lib-kafka-wrapper that uses kafka-clients:2.8.0 dependency: org.apache.kafka kafka-clients 2.8.0 mvn…
Michal Špondr
  • 1,337
  • 2
  • 21
  • 44
0
votes
1 answer

LoggerContext import fails for log4j 2.17.1 in spite of adding Maven dependency

I am trying to use LoggerContext in my Java code. Added the Maven dependency in pom.xml: org.apache.logging.log4j log4j-core 2.17.1
AutoTester999
  • 528
  • 1
  • 6
  • 25
0
votes
2 answers

ApplicationContext not being recognized even after adding Maven dependency

I started a course on spring boot and I am at dependency injection. I ran into a problem with ApplicationContext which I can't seem to resolve: Screenshot of the problem I added the maven dependency as you can see in the pom file: pom file…
0
votes
1 answer

Can a project go to production with non-release versions of dependencies?

I would like to know the difference between RELEASE, SNAPH, and just version number So, I am working on a project, in which I have to change spring-core dependency version from 5.2.9.RELEASE to 5.3.11 In my maven repository, under…
Neha
  • 11
  • 2
0
votes
2 answers

Stop maven dependency from getting further inherited to children

Say we have the following dependency hierarchy in maven: +- projectA | +- projectB | | +- projectC | | +- projectD Here projectB needs certain libraries from projectA (let's say libX). But, those libraries are not needed any further in the…
Satyendra
  • 1,635
  • 3
  • 19
  • 33
0
votes
2 answers

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/Module

I have a Scala sbt project which I am trying to run on my IntelliJ but I am facing exception as: Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/Module I have included the dependency in my build.sbt…
0
votes
1 answer

How to get a Maven dependency to propagate from parent pom to sub-module?

I have a Maven multi-module project. I want to define dependencies in the parent pom , (type pom, not jar) and have sub-modules have the dependency in scope for the code I write. No matter what I do, I cannot get this to work. Simply putting the…
user10664542
  • 1,106
  • 1
  • 23
  • 43