Dependency Management with Maven 2

I have a web application with over 100 jar files pulled out by Maven, and things got a little out of control.

For example, I ended up with 3 versions of Spring of the main classes, which sometimes caused the deployment of the application (it seems that the order of the cans loaded from WEB-INF / lib does not always coincide with Weblogic):

spring-2.5.6.SEC01.jar
spring-2.5.6.A.jar
spring-core-2.0.8.jar

So I'm trying to clear the mess. I started using mostly exceptions, but I'm wondering if I should rely on the dependencyManagement element in my own pom files. What is the best practice?

In addition, the version of transitive dependencies is often not specified. For example, in the spring-security-core 2.0.5.RELEASE pom file there is:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
</dependency>

spring -core , ? ? ?

.

+3
1

, . , , dependencyManagement pom. ?

, (...). spring -core , ? ? ?

, dependencyManagement

"nofollow noreferrer" > spring-security-parent. 2.0.8. .

, dependencyManagement, .

mvn dependency:tree ( ), .

+3
source

Source: https://habr.com/ru/post/1762924/


All Articles