mojohaus / versions

Versions Maven Plugin
https://www.mojohaus.org/versions/versions-maven-plugin/
Apache License 2.0
328 stars 265 forks source link

Add a ability to limit versions to Java version #1047

Open Stwissel opened 4 months ago

Stwissel commented 4 months ago

Problem: mvn versions:show-dependency-updates shows newer versions that eventually need a higher Java version and are not compatible with a current project.

Potential solution: Introduce a configuration setting javaVersion for the versions plugin.

When running the plugin checks the pom of the dependencies for maven.compiler.target (eventually other checks?). When found, compare to the javaVersion and propose an older version if too high (Q: can maven central be queried for a version list?). When not found, print a warning and propose as is now.

This approach would allow to also use profiles to query for different Java versions