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

Snippet generator fails: No enum constant org.jenkinsci.plugins.pipeline.maven.MavenPublisherStrategy

XMLWordPrintable

    • 1290.vf21c81e8c57f

      I tried to get the snippet generator to work for the withMaven step (1274.v870c8cb_fa_369) but it just threw an error on the server:

      java.lang.IllegalArgumentException: No enum constant org.jenkinsci.plugins.pipeline.maven.MavenPublisherStrategy.
      	at java.base/java.lang.Enum.valueOf(Enum.java:240)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:821)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:549)
      	at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:936)
      	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:881)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:766)
      Caused: java.lang.IllegalArgumentException: Failed to instantiate class org.jenkinsci.plugins.pipeline.maven.WithMavenStep from {"maven":"","jdk":"","tempBinDir":"","mavenSettingsConfig":"","mavenSettingsFilePath":"","globalMavenSettingsConfig":"","globalMavenSettingsFilePath":"","mavenOpts":"","traceability":true,"mavenLocalRepo":"","publisherStrategy":"","options":{"stapler-class":"org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher","$class":"org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher","disabled":false,"ignoreAttachments":false,"healthScaleFactor":"1.0","keepLongStdio":true},"":"","stapler-class":"org.jenkinsci.plugins.pipeline.maven.WithMavenStep","$class":"org.jenkinsci.plugins.pipeline.maven.WithMavenStep"}
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:769)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:549)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:544)
      	at hudson.model.Descriptor.bindJSON(Descriptor.java:622)
      	at hudson.model.Descriptor.newInstance(Descriptor.java:592)
      Caused: java.lang.LinkageError: Failed to instantiate class org.jenkinsci.plugins.pipeline.maven.WithMavenStep from {"maven":"","jdk":"","tempBinDir":"","mavenSettingsConfig":"","mavenSettingsFilePath":"","globalMavenSettingsConfig":"","globalMavenSettingsFilePath":"","mavenOpts":"","traceability":true,"mavenLocalRepo":"","publisherStrategy":"","options":{"stapler-class":"org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher","$class":"org.jenkinsci.plugins.pipeline.maven.publishers.JunitTestsPublisher","disabled":false,"ignoreAttachments":false,"healthScaleFactor":"1.0","keepLongStdio":true},"":"","stapler-class":"org.jenkinsci.plugins.pipeline.maven.WithMavenStep","$class":"org.jenkinsci.plugins.pipeline.maven.WithMavenStep"}
      	at hudson.model.Descriptor.newInstance(Descriptor.java:595)
      	at org.jenkinsci.plugins.workflow.cps.Snippetizer.doGenerateSnippet(Snippetizer.java:498)
      

      I did notice in the browser debugger that fillMavenItems, etc. all gave a 403, and in fact the Publisher Strategy dropdown was empty. The HTML response said

      jglick is missing the Job/Configure permission

      This was from Pipeline Syntax on a branch project. I think the problem is that the plugin is checking CONFIGURE permission in doFillXXXItems methods when it should be checking only VIEW_CONFIGURATION. At the multibranch folder level, everything works.

            bguerin Benoit
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: