Hi Ceki,
the compilation-part isn't the real issue (it is acutally the easy part),
but e.g. the testing-part is.
You must ensure that surefire is also executed at least twice: once for
pre-java9 and for java9.
And what to do with other plugins which are part of the lifecycle up until
the package-phase? Very likely they need to be executed twice as well.
If you look closer you'll see that you're actually executing 2 build
lifecycles which are in the end packaged to a single jar.
The demo-project is the purest form but comes with overhead.
Maven has a forking mechanism, but I don't think it is strong enough (yet)
to fully support this.
thanks,
Robert
On Fri, 24 Mar 2017 11:34:20 +0100, Ceki Gülcü <c...@qos.ch> wrote:
Hi All,
Currently in the process modularizing the SLF4J project in preperation
for Java 9/Jigsaw, I ran into many wrinkles most of which are due to
my own ignorance about Java 9 modules. Now that the initial phase of
modularization is done, I am looking into creating mutlti-release
jars (MR-Jars).
Herve's mutli-version demo project [1] (thanks Hervé) while
instructional, shows that MR-Jar support in Maven is perhaps lacking
at the moment.
As a developer, I really don't want to muck about with multiple maven
project modules or learn the intricacies of the maven assembly plugin
just to add module-info.java to my project's artifact.
As a moderately-skilled Maven user, I would like to see MR-Jar
supported by way of directory layout conventions, perhaps along the
lines of:
src/main/java/ -> target/classes
src/test/java/ -> target/test/classes
src/main/java-9/ -> target/classes/META-INF/versions/9
src/test/java-9/ -> target/test-classes/META-INF/versions/9
Thus, I would need to change little in my pom.xml files to support
MR-jars. Most of the leg work would be done by the compiler plug-in
and Maven conventions.
Comments?
--
Ceki
[1] https://github.com/hboutemy/maven-jep238
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org