Closed snuyanzin closed 1 year ago
The problem is that mockito currently does not support jdk17: https://github.com/mockito/mockito/issues/2212
Can be solved by upgrading to latest mockito version.
But javassist's CtClass.toClass() cannot be called with jdk17: https://github.com/jboss-javassist/javassist/issues/400 Currently this issue is not fixed.
I suppose that this issue can be fixed by changing mockito so that mockito will call CtClass.toClass(Class) or CtClass.toClass(Lookup), etc. Please see http://www.javassist.org/html/javassist/CtClass.html#toClass()
This issue seems fixed, am building project with Java 17 all right:
[cstamas@urnebes japicmp (master)]$ mvn -V clean install
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /home/cstamas/.sdkman/candidates/maven/current
Java version: 17.0.3, vendor: Eclipse Adoptium, runtime: /home/cstamas/.sdkman/candidates/java/17.0.3-tem
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.18.6-200.fc36.x86_64", arch: "amd64", family: "unix"
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for japicmp-base 0.15.8-SNAPSHOT:
[INFO]
[INFO] japicmp-base ....................................... SUCCESS [ 0.504 s]
[INFO] japicmp ............................................ SUCCESS [ 8.736 s]
[INFO] japicmp-testbase ................................... SUCCESS [ 0.008 s]
[INFO] japicmp-test-v1 .................................... SUCCESS [ 0.229 s]
[INFO] japicmp-maven-plugin ............................... SUCCESS [ 4.143 s]
[INFO] japicmp-test-v2 .................................... SUCCESS [ 1.518 s]
[INFO] japicmp-test2-v1 ................................... SUCCESS [ 0.035 s]
[INFO] japicmp-test2-v2 ................................... SUCCESS [ 0.041 s]
[INFO] japicmp-test ....................................... SUCCESS [ 4.041 s]
[INFO] japicmp-test-maven-plugin .......................... SUCCESS [ 4.158 s]
[INFO] japicmp-test-maven-plugin-guava .................... SUCCESS [ 0.589 s]
[INFO] japicmp-test-maven-plugin-japicmp .................. SUCCESS [ 0.189 s]
[INFO] japicmp-test-service-impl-base ..................... SUCCESS [ 0.007 s]
[INFO] japicmp-test-service-v1 ............................ SUCCESS [ 0.041 s]
[INFO] japicmp-test-service-v2 ............................ SUCCESS [ 0.035 s]
[INFO] japicmp-test-service-impl-v1 ....................... SUCCESS [ 0.040 s]
[INFO] japicmp-test-service-impl-v2 ....................... SUCCESS [ 0.040 s]
[INFO] japicmp-test-service-test .......................... SUCCESS [ 0.709 s]
[INFO] japicmp-test-maven-plugin-classifier ............... SUCCESS [ 0.464 s]
[INFO] japicmp-test-maven-plugin-pom-module ............... SUCCESS [ 0.020 s]
[INFO] japicmp-test-vx-client ............................. SUCCESS [ 0.326 s]
[INFO] japicmp-test-maven-plugin-ignoremissingartifact .... SUCCESS [ 0.117 s]
[INFO] japicmp-test-maven-plugin-packaging ................ SUCCESS [ 0.347 s]
[INFO] japicmp-testbundle-v1 .............................. SUCCESS [ 0.540 s]
[INFO] japicmp-testbundle-v2 .............................. SUCCESS [ 0.054 s]
[INFO] japicmp-testbundle ................................. SUCCESS [ 1.087 s]
[INFO] japicmp-test-maven-plugin-userproperty ............. SUCCESS [ 0.453 s]
[INFO] japicmp-test-maven-plugin-post-analysis-script-artifact SUCCESS [ 0.020 s]
[INFO] japicmp-test-maven-plugin-post-analysis-script-artifact-test SUCCESS [ 0.880 s]
[INFO] japicmp-ant-task ................................... SUCCESS [ 2.469 s]
[INFO] japicmp-test-ant-task .............................. SUCCESS [ 0.837 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.428 s
[INFO] Finished at: 2022-06-27T11:49:41+02:00
[INFO] ------------------------------------------------------------------------
[cstamas@urnebes japicmp (master)]$
Probably the reason is that since jdk 17
--illegal-access
does not make any case as mentioned at https://openjdk.java.net/jeps/403 Build fails with