[ 
https://issues.apache.org/jira/browse/MCOMPILER-323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16361315#comment-16361315
 ] 

Robert Scholte commented on MCOMPILER-323:
------------------------------------------

I've had a look in the past and came to the conclusion that this would 
introduce way too much magic. Right now every execution blocks will execute the 
java compiler exactly once. A multirelease jar will always require multiple 
java compiler calls.

I still think that multirelease jars should be avoided and only be used when 
there's a very good reason for it. Assuming those projects are experienced 
Maven users, they should be able to resolve it already right now. My biggest 
concern is actually not compiling a MRJAR, but unttesting it with all the Java 
versions.

For that reason [~hboutemy] came with a pattern: 
[https://github.com/hboutemy/maven-jep238]

Downside is that it is a multimodule Maven project, however every module is 
tested with the correct Java version.

If you still think this can be solved properly, I'm all ears.

 

> Support multi-release jars
> --------------------------
>
>                 Key: MCOMPILER-323
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-323
>             Project: Maven Compiler Plugin
>          Issue Type: Improvement
>            Reporter: Mike Drob
>            Priority: Major
>
> Java 9 allows for JRE version specific code in the form of "multi-release 
> jars"
> Older JREs will treat them as normal jars, while newer JREs will load the 
> appropriate specific classes. AFAICT, maven does not currently support this.
> Compiler plugin should automatically detect when there are multiple source 
> levels and set MRJAR=True in the manifest.
> Source directories could potentially be src/main/java, src/main/java9, 
> src/main/java10, etc. These probably need to be configurable as well, or some 
> deeper discussion about what makes sense and is intuitive for users.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to