Build failure on JDK15 since PR #990

44 views
Skip to first unread message

Marc Hoffmann

unread,
Jan 8, 2020, 12:57:54 AM1/8/20
to jacoc...@googlegroups.com

Hi Evgeny,

since we added —enable-preview our build fails on latest Java 15 (with -Dbytecode.version=14):
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project org.jacoco.core.test.validation.java14: Compilation failure
[ERROR] invalid source release 14 with --enable-preview
[ERROR] (preview language features are only supported for release 15)
Using -Dbytecode.version=15 is not an option (yet):
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.1:shade (default) on project org.jacoco.agent.rt: Error creating shaded jar: Unsupported class file major version 59 -> [Help 1]

Any ideas how to fix our build for Java 15? Except excluding the new validation tests?

Cheers,
-marc

Evgeny Mandrikov

unread,
Jan 8, 2020, 11:10:40 AM1/8/20
to JaCoCo Developers
Hi Marc,

Indeed there is a problem with "--enable-preview" flag - it requires match between bytecode version and JDK.

I see following options, ordered starting from a simplest one:
1. remove validation test
2. move it to a new module e.g. "org.jacoco.core.test.validation.java_preview", whose inclusion into build should/would be explicit i.e. "mvn -Ppreview", so that we'll enable it only when building with JDK 14 and later for JDK 15 when we'll add support for its bytecode 
3. move it to a new module java15 module and add support for JDK 15 bytecode, for maven-shade-plugin and JDK 14 we already have https://github.com/jacoco/jacoco/blob/v0.8.5/org.jacoco.build/pom.xml#L809-L815 which can be extended/copied for JDK 15

Which one do you prefer?


Regards,
Evgeny

Marc Hoffmann

unread,
Jan 9, 2020, 11:38:52 AM1/9/20
to jacoc...@googlegroups.com
Hi Evgeny,

if we add functionality for preview features this should be tested. Also I think it’s a good idea to have support (and tests) for preview features to make sure JaCoCo is ready for the next Java release and we can report potential issues early to OpenJDK. But: I would not officially support them.

This means it is enough to test them on our highest supported release only. If there is no official support we don’t need to test them on older JDK versions (which would result in a feature/jdk matrix).

So the preview flag would only be used in the highest JDK we support and we need to move tests for preview features when we add support for a new version.

This means option 3.

Cheers,
-marc




--
You received this message because you are subscribed to the Google Groups "JaCoCo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco-dev/ed239f8c-700b-47ef-b977-ffc11dfa9e91%40googlegroups.com.

Evgeny Mandrikov

unread,
Jan 9, 2020, 11:43:04 AM1/9/20
to jacoc...@googlegroups.com
Hi Marc,

Fully agree with you!

I prepared changes, but currently away from my machine, so will open PR later tonight.


Regards,
Evgeny

--
Regards,
Evgeny

Evgeny Mandrikov

unread,
Jan 13, 2020, 10:40:43 AM1/13/20
to JaCoCo Developers
Hi Marc,

Once it will be merged, your build with JDK 15 will succeed as can be seen in Travis for this PR.

To unsubscribe from this group and stop receiving emails from it, send an email to jacoco-dev+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "JaCoCo Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco-dev+unsubscribe@googlegroups.com.
--
Regards,
Evgeny

Marc Hoffmann

unread,
Jan 13, 2020, 11:10:02 AM1/13/20
to jacoc...@googlegroups.com
Hi Evgeny,

review and merge was done.

I needed some time to wrap my mind around the fact that it is now compiling successfully.

—> validation.java14 with JDK 15 is now compiled with to java 15 bytecode —> preview flag works :)

So reconsidering my earlier suggestion I would actually keep switch expressions and records in validation.java14 for now. Once features get official we can move them to the respective java version.

Cheers,
-marc

To unsubscribe from this group and stop receiving emails from it, send an email to jacoco-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jacoco-dev/de6423a1-830e-46bf-9fdd-5ea5e3208b9e%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages