Mikaël Geljić commented on MCOMPILER-323:

Hi there, I'm adding my vote to this one.

I also don't expect a single compiler execution. What's annoying me is that 
typically those additional source directories are added through the 
build-helper plugin; and the compiler plugin just eats it all and passes that 
to the javac {{sourcepath}} 

All we have is exclude filters, which may work for {{module-infos}}, but by 
splitting the source dirs we already shift to compile arbitrary java9 sources 
\*with jdk9 apis\*; filtering by package/class-name is not an option, 
especially as with JEP-238 sources are supposed to overlay one another.
Excludes are only relative to source roots and this is what's limiting here.

Would the compiler plugin consider more awareness of source dirs? Or would it 
be kept away as a build-helper plugin concern?

Re: the multi-module approach, I don't buy it, as it generates tons of fuss 
maven-wise and slightly ruins the purpose of the JEP which was to address those 
different artifact coordinates per java target release.

Long term maybe we can come up with high level config/convention to trigger 
multiple compilations & test-runs. Yet for now re: unit-testing, I'd say that's 
as much a concern of separate surefire executions upon src/test/java vs. 
src/test/java9... in case that's what's blocking here. :)


> 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

Reply via email to