Maven: find a package

Updated: 2020-07-15

Did you get a warning with maven, your pom.xml has problems, what to do?

When you build your maven project you could have an error or a warning like:

[WARNING] The POM for com.sun.xml.bind:jaxb-osgi:2.2.10 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details

How to find the dependency that include jaxb-osgi?

You can ask maven to show the chain of dependencies until this package:

mvn dependency:tree -Dincludes=com.sun.xml.bind:jaxb-osgi:jar

You will have a result similar to this one:

[INFO] 
[INFO] --- maven-dependency-plugin:3.0.2:tree (default-cli) @ your-project-name --- 
[INFO] your-project:SNAPSHOT 
[INFO] \- io.rest-assured:rest-assured:jar:3.0.0:test 
[INFO]    \- io.rest-assured:xml-path:jar:3.3.0:test 
[INFO]       \- com.sun.xml.bind:jaxb-osgi:jar:2.2.10:test 
[INFO] ------------------------------------------------------------------------ 
[INFO] Reactor Summary for your-project-name-SNAPSHOT: 

WebApp built by Marco using SpringBoot 3.2.4 and Java 21, in a Server in Switzerland