Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-55233

email-ext: PowerMock is not compatible with Java 11

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • email-ext-plugin
    • Jenkins 2.155
      Java 11
      PCT
    • 2.64

      Current version of PowerMock used for testing is not compatible with Java 11.  So tests are failing with 

      Caused by: java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.powermock.core.classloader.MockClassLoader @7cd1ec54 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl 

      Updating Parent POM to 3.30 to benefit from new versions of the libraries should be sufficient.

          [JENKINS-55233] email-ext: PowerMock is not compatible with Java 11

          Adrien Lecharpentier created issue -
          Adrien Lecharpentier made changes -
          Epic Link New: JENKINS-51805 [ 191255 ]
          Adrien Lecharpentier made changes -
          Link New: This issue depends on JENKINS-55098 [ JENKINS-55098 ]
          Adrien Lecharpentier made changes -
          Description Original: Current version of PowerMock used for testing is not compatible with Java 11.  So tests are failing with 
          {noformat}
          Caused by: java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.powermock.core.classloader.MockClassLoader @7cd1ec54 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl {noformat}
          New: Current version of PowerMock used for testing is not compatible with Java 11.  So tests are failing with 
          {noformat}
          Caused by: java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.powermock.core.classloader.MockClassLoader @7cd1ec54 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl {noformat}
          Updating Parent POM to {{3.30}} to benefit from new versions of the libraries should be sufficient.

          Oleg Nenashev added a comment -

          For the record, it's better to pick up 3.31 with the "hpi:run" fix

          Oleg Nenashev added a comment - For the record, it's better to pick up 3.31 with the "hpi:run" fix

          Adrien Lecharpentier added a comment - - edited

          Updating to 3.30 is not enough. powermock-reflect depends on objenesis:3.0.1 but the parent-pom set the version to 2.0.6 and the version 3.0.1 is blacklisted. It requires more in-depth search.

          Here is the log of the build with Parent POM 3.30 or 3.31:

          [WARNING] Rule 4: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
          Failed while enforcing RequireUpperBoundDeps. The error(s) are [
          Require upper bound dependencies error for org.objenesis:objenesis:2.6 paths to dependency are:
          +-org.jenkins-ci.plugins:email-ext:2.64-SNAPSHOT
            +-org.mockito:mockito-core:2.23.4
              +-org.objenesis:objenesis:2.6
          and
          +-org.jenkins-ci.plugins:email-ext:2.64-SNAPSHOT
            +-org.powermock:powermock-module-junit4:2.0.0-RC.4
              +-org.powermock:powermock-module-junit4-common:2.0.0-RC.4
                +-org.powermock:powermock-reflect:2.0.0-RC.4
                  +-org.objenesis:objenesis:2.6 (managed) <-- org.objenesis:objenesis:3.0.1
          ]
          

          Adrien Lecharpentier added a comment - - edited Updating to 3.30 is not enough. powermock-reflect depends on objenesis:3.0.1 but the parent-pom set the version to 2.0.6 and the version 3.0.1 is blacklisted. It requires more in-depth search. Here is the log of the build with Parent POM 3.30 or 3.31 : [WARNING] Rule 4: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message: Failed while enforcing RequireUpperBoundDeps. The error(s) are [ Require upper bound dependencies error for org.objenesis:objenesis:2.6 paths to dependency are: +-org.jenkins-ci.plugins:email-ext:2.64-SNAPSHOT +-org.mockito:mockito-core:2.23.4 +-org.objenesis:objenesis:2.6 and +-org.jenkins-ci.plugins:email-ext:2.64-SNAPSHOT +-org.powermock:powermock-module-junit4:2.0.0-RC.4 +-org.powermock:powermock-module-junit4-common:2.0.0-RC.4 +-org.powermock:powermock-reflect:2.0.0-RC.4 +-org.objenesis:objenesis:2.6 (managed) <-- org.objenesis:objenesis:3.0.1 ]

          Oleg Nenashev added a comment -

          alecharp OK, so we need to upgrade the Plugin POM. I didn't catch this issue, but I believe it depends on the dependency declaration order.

          Oleg Nenashev added a comment - alecharp OK, so we need to upgrade the Plugin POM. I didn't catch this issue, but I believe it depends on the dependency declaration order.

          oleg_nenashev that would be odd but I can try that. 

          Adrien Lecharpentier added a comment - oleg_nenashev that would be odd but I can try that. 
          Adrien Lecharpentier made changes -
          Labels Original: java11 java11-devtools-compatibility New: java11 java11-compatibility
          Oleg Nenashev made changes -
          Assignee Original: David van Laatum [ davidvanlaatum ] New: Oleg Nenashev [ oleg_nenashev ]

            alecharp Adrien Lecharpentier
            alecharp Adrien Lecharpentier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: