Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Currently only the minimum Maven version can be explicitly required for a Maven plugin via prerequisites->maven. The same should be possible for the Java version, as Maven plugins compiled for Java 11 won't run on Java 8 and currently only emit the nasty "UnsupportedClassVersion" errors.
The plugin reporting plugin uses some heuristics in https://github.com/apache/maven-plugin-tools/blob/c6d0808b92423b969f8d2aac500b7263399d0373/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java#L739, but this is only considered for the plugin documentation but never at run time. This metadata should be evaluated similar to prerequisites.maven at https://github.com/apache/maven/blob/0080e845884922814d26914d0ae9f59b084bee35/maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java#L173
This requires a Maven model change though, and therefore can only end up in Maven 5.
Attachments
Issue Links
- duplicates
-
MNG-7566 Allow a Maven plugin to require a Java version through its plugin descriptor
- Closed