Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
357 views
in Technique[技术] by (71.8m points)

Maven same dependency in multiple dependencies

Let's say I have 3 libs, compiled using Maven: A, B and C.

And let's say I have this project:

image

Dependency C is included in A and B.

After compiling My project, dependency C will be present by 3 times? Or just once?

All of them use same version of C

question from:https://stackoverflow.com/questions/65922464/maven-same-dependency-in-multiple-dependencies

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Maven manages transitive dependencies in a way that of each artifact, only one version will be used for the project.

If you have different versions, the version is decided by Maven dependency mediation.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...