Maven rules out best practices

I am using Maven2. When I look at the output mvn dependency:tree -Dverbose, I see a lot:

[INFO] +- org.springframework:spring-orm:jar:3.0.5.RELEASE:compile
[INFO] |  +- (org.springframework:spring-beans:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework:spring-core:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.springframework:spring-jdbc:jar:3.0.5.RELEASE:compile - omitted for duplicate)
[INFO] |  \- (org.springframework:spring-tx:jar:3.0.5.RELEASE:compile - omitted for duplicate)

All of them are also included in my pom as dependencies. My question is how to follow the policy, leave it, exclude only version conflicts or exclude every transitive dependency.

I could not see anything related to this in the manual.

Thank!

+3
source share
3 answers

Duplication of dependencies is not a problem with maven, so you can leave it as it is. (Every other artifact depends on apache.logging - you do not need to worry about it, maven takes care of you)

, .

( , ):

, java, . .

dependecy

+2

( ) , java, . , .

; , . mvn : .

. . , pom. .

-, ( ).

.

+1

In the case where you gave there, you only need to specify the dependency, which means providing only the dependency for org.springframework: spring -orm: jar: 3.0.5.RELEASE: compile, but not for others. This will make your pom slim ...

0
source

All Articles