Reputation: 4833
Consider I have a maven java project that I wish to use the minimum version of Java possible. It has a number of dependencies. Is there a way I can see what the version of java used to compile the jar is for all of the resolved dependencies?
Upvotes: 9
Views: 4621
Reputation: 12196
If you run mvn site
on your project, one of the default reports (the 'Dependencies' report) generated will give you details about your dependencies.
After running mvn site
find the target/site/dependencies.html
file and open it in a browser. The section entitled "Dependency File Details" has a table in which one of the columns is the JDK revision used to compile a given dependency.
The maven-project-info-reports-plugin is what is responsible for generating this information. If you just want to generate that single html report from the command line you can do so with the following command
mvn project-info-reports:dependencies
The report will be located in the same place as with mvn site
at target/site/dependencies.html
Upvotes: 9