jenkinsci / peass-ci-plugin

Jenkins plugin for peass to support performance measurement in CI
https://plugins.jenkins.io/peass-ci/
GNU Affero General Public License v3.0
4 stars 13 forks source link

Java 17 Compatibility #155

Closed mawHBT closed 2 years ago

mawHBT commented 2 years ago

What feature do you want to see added?

Building peass-ci with java-17 on ubuntu works, if you skip the tests. If you don't, you get various errors, e.g.:

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @2b1694
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
    at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
    at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:199)
    at java.base/java.lang.reflect.Method.setAccessible(Method.java:193)
    at org.mockito.cglib.core.ReflectUtils$2.run(ReflectUtils.java:57)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at org.mockito.cglib.core.ReflectUtils.<clinit>(ReflectUtils.java:47)

Peass-ci should be made fully compatible with java-17.

Upstream changes

No response

DaGeRe commented 2 years ago

When I execute a peass-ci job with Java 17, I get the following error: https://nopaste.net/7EguUtss5a it seems to me like Jenkins is still not ready for Java 17, even if its now in preview state (https://www.jenkins.io/blog/2022/03/21/java17-preview-availability/). I think we should postpone this issue until Jenkins officially fully supporting Java 17.

DaGeRe commented 2 years ago

Peass-CI itself has also problems running on Java 17, so I created an issue: https://issues.jenkins.io/browse/JENKINS-68860

DaGeRe commented 2 years ago

According to https://www.jenkins.io/doc/administration/requirements/upgrade-java-guidelines/, updates to Jenkins versions above 2.357 (including our current LTS 2.346.1) will render our plugin unusable for Jenkins running on Java 8 (adding a Java 8 JVM for runs should still be possible). This should be noted.

According to https://issues.jenkins.io/browse/JENKINS-68860, we should update to parent version 4.40. I did this, but the Java 17 errors still appear.

DaGeRe commented 2 years ago

This should work with the current Jenkins version. Does this work for you?

mawHBT commented 2 years ago

I built peass-ci, running all tests locally. Worked for me.

DaGeRe commented 2 years ago

Ok, so I'll close this issue.