Is there a way to list the java version of all my maven dependencies?
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?
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
上一篇: 在课堂上静态块和分配静态之间的区别?