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

Support of testing Jenkins plugins with Java 11 on CI

      AFAIK dnusbaum is working on it.

          [JENKINS-52094] Support of testing Jenkins plugins with Java 11 on CI

          Devin Nusbaum added a comment -

          With compilation working what I was experimenting with is not as important, but for the record here is the idea:

          1. Get a WAR file with the plugin(s) you want to test (custom-war-packager might be helpful) based on a version of Jenkins core with Java 10 fixes (i.e. The java10-support branch).
          2. Create a Java properties file named java10.properties with the following content (can add extra maven arguments as needed)
            jvm = $JAVA10_HOME/bin/java
            argLine = --add-modules java.xml.bind"
            
          3. Run the PCT using that WAR file passing the argument -mavenPropertiesFile=java10.properties to the PCT.

          The effect is that the Java 10 JVM will be used to run tests, while the default version of Java on the machine (presumably Java 8) will be used for compilation. This could be made more robust by preparing Docker images based on maven-jdk8 images with Java 10 installed but not set as the default, and then using the runPCT step on ci.jenkins.io with that image.

          You could also pass those options to a standard Maven build, but you will also have to override the version of Jenkins being used. To me it seemed that the most likely case for Java 10 testing if compilation wasn't working was to do bulk testing of many plugins at once, which is why I experimented with the PCT.

          Devin Nusbaum added a comment - With compilation working what I was experimenting with is not as important, but for the record here is the idea: Get a WAR file with the plugin(s) you want to test ( custom-war-packager might be helpful) based on a version of Jenkins core with Java 10 fixes (i.e. The java10-support branch). Create a Java properties file named java10.properties with the following content (can add extra maven arguments as needed) jvm = $JAVA10_HOME/bin/java argLine = --add-modules java.xml.bind" Run the PCT using that WAR file passing the argument -mavenPropertiesFile=java10.properties to the PCT. The effect is that the Java 10 JVM will be used to run tests, while the default version of Java on the machine (presumably Java 8) will be used for compilation. This could be made more robust by preparing Docker images based on maven-jdk8 images with Java 10 installed but not set as the default, and then using the runPCT step on ci.jenkins.io with that image. You could also pass those options to a standard Maven build, but you will also have to override the version of Jenkins being used. To me it seemed that the most likely case for Java 10 testing if compilation wasn't working was to do bulk testing of many plugins at once, which is why I experimented with the PCT.

          Oleg Nenashev added a comment -

          I made some patches, and now it is possible. E.g. https://github.com/jenkinsci/label-verifier-plugin/pull/4 

          Dev Tools still need some fixes before we fully close it

          Oleg Nenashev added a comment - I made some patches, and now it is possible. E.g. https://github.com/jenkinsci/label-verifier-plugin/pull/4   Dev Tools still need some fixes before we fully close it

          Oleg Nenashev added a comment -

          We did gradual improvements in Plugin POMs

           

          Oleg Nenashev added a comment - We did gradual improvements in Plugin POMs  

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: