-
Notifications
You must be signed in to change notification settings - Fork 189
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org.eclipse.tycho.surefire.junit* libs should still be Java 1.8 compatible #70
Comments
FWIW, I am willing to create a pull request. |
Then go ahaed I don't see any reason not to merge it if all tests still pass :-) The problem could really be the module-info.class as the manifest is generated using BND and this uses the highest classversion by default. |
Just to make sure: are you certain it's not profitable for your use-case to just fully use Java 11 ? Java 8 compatibility is now an extra cost, so fully getting rid of it could be beneficial for you. |
…test runtime The test runtime (Surefire Booter + JUnit/TestNG Runners) only contains classes still compatible with Java 8, but unnecessarily declares a Java 11 requirement. This prevents using toolchains to test against older Java versions.
Uses the maven-enforcer-plugin to enforce that all dependencies part of the Surefire Booter and JUnit/TestNG Runners do not contain class files requiring Java 9 or later. (META-INF/versions/**.class and module-info.class are safe and ignored.)
We build a plug-in using Tycho that has to support older Eclipse versions as well (well, really old ones like Luna). In particular, we have to support Eclipse versions which do not even launch on Java 11. Hence, we would like to test against such older versions (easily done using an appropriate Of course, as soon as JUnit drops Java 8 support, we will have to move on with our tests, at least for the toolchain part, but that hasn’t happened yet. 🤞
I use the
Is this enough of a test case? I must admit the whole |
It's more up to you to consider. I know most of us won't care if this is back to Java 11, so it's all about how much this check makes you feel safe ;) |
Alright. I added a comment to the And if JUnit ever decides to switch to a newer bytecode version, the So from my point of view, pull request #71 is good to go. |
The test runtime (Surefire Booter + JUnit/TestNG Runners) only contains classes still compatible with Java 8, but unnecessarily declares a Java 11 requirement. This prevents using toolchains to test against older Java versions.
Uses the maven-enforcer-plugin to enforce that all dependencies part of the Surefire Booter and JUnit/TestNG Runners do not contain class files requiring Java 9 or later. (META-INF/versions/**.class and module-info.class are safe and ignored.)
PR merged, thanks @sewe |
Since Tycho 2.0, the Tycho maven plugins require Java 11. That’s fine. Unfortunately, since Tycho 2.1.0, your tests now also require Java 11, even if they themselves have a
Bundle-RequiredExecutionEnvironment
ofJavaSE-1.8
and a toolchain is configured to launch the tests with a Java 1.8 JVM.Ultimately, the test runtime fails to launch with an error message like this one:
And this is unfortunate, as the
org.eclipse.tycho.surefire.junit*
libraries really don’t require Java 11. The only version 55.0 (aka Java 11) class file in theorg.eclipse.tycho.surefire.junit57-2.3.0.jar
, for example, ismodule-info.class
. And then there are these two classes:But they are, as befits a multi-version JAR, hidden away in
META-INF/versions/9
, so all that prevents the test runtime from still supporting Java 1.8 is a too restrictiveRequire-Capability
declaration.I hence propose to still declare the
org.eclipse.tycho.surefire.junit*
libraries as compatible with Java 1.8 – which they are, in fact. This makes it possible, using toolchains, to build your plugins with Java 11, but still test them against Java 1.8, if that’s what they need to run against in the wild.The text was updated successfully, but these errors were encountered: