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

JEP-200 Global Pipeline Libraries can't filter class

XMLWordPrintable

      I have maintained a Global Pipeline Library code that uses the "hudson. plugins. my. devops. action. ShareIndexAction" custom class to store some index data that can be read from different job builds. How do I solve the JEP-200 problem when the following error occurs?

      class source:

      #!/usr/bin/groovy
      package hudson.plugins.my.devops.action
      import org.apache.commons.lang.StringUtils
      import hudson.model.Actionclass ShareIndexAction implements Serializable,Action {
          String shareUuid;
          Integer shareIndex;    
          
          ShareIndexAction() {
              this.shareUuid = null;
              this.shareIndex = null;
          }   
      
          ShareIndexAction(def _uuid, def _index=null) {
              this.shareUuid = _uuid;
              this.shareIndex = _index;
          }    
      
          /* interface */
          @NonCPS
          public String getIconFileName() {
              return null
          }    
      
          public String getDisplayName() {
              return "#${this.shareIndex} - ${this.shareUuid}"
          }   
      
          @NonCPS
          public String getUrlName() {
              return null
          }
      }
      

      I use this class in vars/mycode.groovy,when upgrade to jenkins 2.121.2 is has JEP-200 issue。

      job log output:

      java.lang.UnsupportedOperationException: Refusing to marshal hudson.plugins.my.devops.action.ShareIndexAction for security reasons; see https://jenkins.io/redirect/class-filter/
      

            Unassigned Unassigned
            galphy gao fei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: