Executing the test suit for gradle-plugin against jenkins-core:2.107.2 to check compatibility, several of them are failing due to a Serialization exception. These errors seems to be related to JEP-200. As example, the following trace shows one of the exceptions:
       

      java.lang.RuntimeException: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	at hudson.util.PersistedList._onModified(PersistedList.java:183)
      	at hudson.util.PersistedList.add(PersistedList.java:72)
      	at org.jvnet.hudson.test.JenkinsRule.configRoundtrip(JenkinsRule.java:1086)
      	at hudson.plugins.gradle.GradlePluginIntegrationTest.Config roundtrip(GradlePluginIntegrationTest.groovy:180)
      Caused by: java.io.IOException: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	at hudson.XmlFile.write(XmlFile.java:201)
      	at hudson.model.AbstractItem.save(AbstractItem.java:483)
      	at hudson.model.Job.save(Job.java:196)
      	at hudson.model.AbstractProject.save(AbstractProject.java:289)
      	at hudson.util.PersistedList.onModified(PersistedList.java:173)
      	at hudson.util.PersistedList._onModified(PersistedList.java:181)
      	... 3 more
      Caused by: java.lang.RuntimeException: Failed to serialize hudson.model.Project#builders for class hudson.model.FreeStyleProject
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:256)
      	at hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:224)
      	at com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)
      	at hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)
      	at hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      	at com.thoughtworks.xstream.core.TreeMarshaller.start(TreeMarshaller.java:82)
      	at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.marshal(AbstractTreeMarshallingStrategy.java:37)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1026)
      	at com.thoughtworks.xstream.XStream.marshal(XStream.java:1015)
      	at com.thoughtworks.xstream.XStream.toXML(XStream.java:988)
      	at hudson.XmlFile.write(XmlFile.java:194)
      	... 8 more
      Caused by: java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.gradle.Gradle for security reasons; see https://jenkins.io/redirect/class-filter/
      	at hudson.util.XStream2$BlacklistedTypesConverter.marshal(XStream2.java:530)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)
      	at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)
      	at hudson.util.DescribableList$ConverterImpl.marshal(DescribableList.java:269)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)
      	at com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)
      	at com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)
      	at hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:265)
      	at hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:252)
      	... 21 more
      

          [JENKINS-51062] JEP-200 issue with plugin Gradle Plugin

          After analysing all the exceptions, the classes that seem to be affected are:

          • hudson.plugins.gradle.BuildScanAction
          • hudson.plugins.gradle.Gradle
          • hudson.plugins.gradle.Gradle$DescriptorImpl
          • hudson.plugins.gradle.GradleInstallation
          • hudson.plugins.gradle.GradleInstallation$DescriptorImpl
          • hudson.plugins.gradle.GradleInstaller

          All of them seems to be fine since their non transient field are String, so probably the fix could be just adding those class to the whitelist (via hudson.remoting.ClassFilter file).

          Francisco Fernández added a comment - After analysing all the exceptions, the classes that seem to be affected are: hudson.plugins.gradle.BuildScanAction hudson.plugins.gradle.Gradle hudson.plugins.gradle.Gradle$DescriptorImpl hudson.plugins.gradle.GradleInstallation hudson.plugins.gradle.GradleInstallation$DescriptorImpl hudson.plugins.gradle.GradleInstaller All of them seems to be fine since their non transient field are String, so probably the fix could be just adding those class to the whitelist (via hudson.remoting.ClassFilter file).

          Oleg Nenashev added a comment -

          As discussed, it is likely an issue with development tools (obsolete JTH, etc.). The issue cannot be reproduced on a real instance

          Oleg Nenashev added a comment - As discussed, it is likely an issue with development tools (obsolete JTH, etc.). The issue cannot be reproduced on a real instance

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/jenkins/security/ClassFilterImpl.java
          http://jenkins-ci.org/commit/jenkins/b14ba46a141b21d5f45679d2871376d8b12583d2
          Log:
          JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/jenkins/security/ClassFilterImpl.java http://jenkins-ci.org/commit/jenkins/b14ba46a141b21d5f45679d2871376d8b12583d2 Log: JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds.

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/security/ClassFilterImpl.java
          http://jenkins-ci.org/commit/jenkins/a4a1355f518f282d1f8f73a640b71aae3680f2a6
          Log:
          Merge pull request #3420 from jglick/gradle-plugin-under-test-JENKINS-51062

          JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds

          Compare: https://github.com/jenkinsci/jenkins/compare/d1eaafb28bda...a4a1355f518f
          *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

          Functionality will be removed from GitHub.com on January 31st, 2019.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/security/ClassFilterImpl.java http://jenkins-ci.org/commit/jenkins/a4a1355f518f282d1f8f73a640b71aae3680f2a6 Log: Merge pull request #3420 from jglick/gradle-plugin-under-test- JENKINS-51062 JENKINS-51062 Extend ClassFilterImpl.isLocationWhitelisted Maven-oriented exclusions to plugin under test during Gradle builds Compare: https://github.com/jenkinsci/jenkins/compare/d1eaafb28bda...a4a1355f518f * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.

          Oleg Nenashev added a comment -

          Fixed in 2.120

          Oleg Nenashev added a comment - Fixed in 2.120

          Oleg Nenashev added a comment -

          LTS backporting is not needed since we picked 2.121.x as a baseline

          Oleg Nenashev added a comment - LTS backporting is not needed since we picked 2.121.x as a baseline

            jglick Jesse Glick
            fcojfernandez Francisco Fernández
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: