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

Plugins should switch to '$class' from 'stapler-class' and 'kind'

XMLWordPrintable

      The field name used to specify class names in structured form is changed to $class from stapler-class and kind.
      Plugins using `stapler-class` or `kind` should follow that change as they may not get to work in future versions of Jenkins.

      They doesn't stop working immediately as Jenkins keeps the backward compatibility (it continues to send and receive stapler-class and kind).

      Instructions for plugins:

      • For plugins using stapler-class or kind in jelly files
        • You should use proper tags provided by Jenkins core, such as descriptorRadioList and dropdownDescriptorSelector.
        • lib/form/class-entry will be provided in the next version of Jenkins.
      • For plugins using stapler-class or kind in Java codes
        • Do like this:
          String clazzName = formData.optString("$class", null);
          if (clazzName == null) {
              // Fall back on the legacy stapler-class attribute.
              clazzName = formData.optString("stapler-class", null);
          }
          
        • Jenkins core should provide an alternate way in a future release so that plugins no longer need to access stapler-class and $class.

      See:

            ikedam ikedam
            ikedam ikedam
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: