So you wanna know where your maven dependency version comes from ?
You work with a complex maven project. That's a fact, otherwise you wouldn't be here, searching to uncover a way out of its dependencies maze. Your project probably has a parent, as your parent might also have one. You may have boms in your dependency management, but your parent certainly has one too. You defined properties, and guess what, so have at least a dozen direct or transitive dependencies. So after having done you researched, not relying on some gibberish from whatever AI assistant you usually use, you found out about : mvn dependency:tree While that does give you a nice console output, chances are it's not enough. Again, you wouldn't be here if it was. It does tell you the dependency version used, where they were pulled out from, but why is that specific version used can still be unclear. Let's say you have a dependency somewhere in you project hierarchy defined as followed: org.springframework.boot spring-boot-starter-web ${spring.boot.version} The property value is defined to be 3.4.4 in your parent, but the the dependency:tree plugin output tells you the value is 2.7.9, and so you rightfully ask yourself, why the f... is that. Well it just happens that this can be easily solved using the help plugin: mvn help:effective-pom -Dverbose=true It will spit out your pom as seen by the great maven itself. The only issue is that chances are great that your console buffer will be overflowed. But we are smarter than that. mvn help:effective-pom -Dverbose=true | grep spring.boot.version It will give you something like : 2.7.9 There! You have it! Of course your exotic dependency is the culprit. Now that you know it, it will be much easier to fix. Don't you think ?
You work with a complex maven project. That's a fact, otherwise you wouldn't be here, searching to uncover a way out of its dependencies maze.
Your project probably has a parent
, as your parent
might also have one.
You may have boms
in your dependency management, but your parent
certainly has one too.
You defined properties
, and guess what, so have at least a dozen direct or transitive dependencies.
So after having done you researched, not relying on some gibberish from whatever AI assistant you usually use, you found out about :
mvn dependency:tree
While that does give you a nice console output, chances are it's not enough. Again, you wouldn't be here if it was.
It does tell you the dependency version used, where they were pulled out from, but why is that specific version used can still be unclear.
Let's say you have a dependency somewhere in you project hierarchy defined as followed:
org.springframework.boot
spring-boot-starter-web
${spring.boot.version}
The property value is defined to be 3.4.4
in your parent, but the the dependency:tree
plugin output tells you the value is 2.7.9
, and so you rightfully ask yourself, why the f... is that.
Well it just happens that this can be easily solved using the help
plugin:
mvn help:effective-pom -Dverbose=true
It will spit out your pom as seen by the great maven
itself. The only issue is that chances are great that your console buffer will be overflowed. But we are smarter than that.
mvn help:effective-pom -Dverbose=true | grep spring.boot.version
It will give you something like :
2.7.9 <!-- com.acme:your.exotic.dependency:17.0.18-RC3-FINAL-GA, line 253 -->
There! You have it! Of course your exotic dependency is the culprit. Now that you know it, it will be much easier to fix. Don't you think ?