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

dependency-track-plugin 2.3.0 crashes declarative pipeline job

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      After upgrade from dependency-track plugin 2.2.1 to 2.30, all my Jenkins jobs that use declarative pipelines instantly crashed.

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: 91: Invalid parameter "artifactType", did you mean "artifact"? @ line 91, column 19.
                           artifactType: 'bom',
      
      1 error
      
      	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
      	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
      	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
      

      Jenkinsfile contained:

      dependencyTrackPublisher(
                        artifact: 'bom.xml',
                        artifactType: 'bom',
                        projectId: '63d57c58-0437-4cdd-a020-a870eba81956',
                        synchronous: true)
            }
      

      Removal of artifactType line addressed the issue.

      Problems:

      • Could not the change have been implemented in a way that resulted in a warning rather than an error? (FWIW, our scripted pipelines gave warnings and not errors).
      • Failing that, should not such a breaking change have resulted in the version number bumping to 3.0.0 rather than 2.3.0?
      • There are no release notes published, nor warning in the project readme.md
      • The readme still shows info for the old version (eg, screenshot with "Choose artifact type".

        Attachments

          Activity

          Show
          sspringett Steve Springett added a comment - Fixed in:  https://github.com/jenkinsci/dependency-track-plugin/commit/9203f702005c090bff7898ce91cafac9a26a8b7d
          Hide
          sspringett Steve Springett added a comment - - edited

          Attempted to fix by introducing a second @DataBoundConstructor annotation that supported artifactType. Turns out that this is a known issue with Jenkins plugins. They are unable to do this due to known issues in third party components.

           

          This is the output when compiling the plugin. When the secondary constructor is removed, it compiles properly.

           

          javax.annotation.processing.FilerException: Attempt to reopen a file for path /Users/steve/Development/Dependency-Track/jenkins-plugin/target/classes/org/jenkinsci/plugins/DependencyTrack/DependencyTrackPublisher.stapler
           at com.sun.tools.javac.processing.JavacFiler.checkFileReopening(JavacFiler.java:535)
           at com.sun.tools.javac.processing.JavacFiler.createResource(JavacFiler.java:431)
           at org.kohsuke.stapler.jsr269.AbstractProcessorImpl.createResource(AbstractProcessorImpl.java:81)
           at org.kohsuke.stapler.jsr269.AbstractProcessorImpl.writePropertyFile(AbstractProcessorImpl.java:67)
           at org.kohsuke.stapler.jsr269.ConstructorProcessor.write(ConstructorProcessor.java:98)
           at org.kohsuke.stapler.jsr269.ConstructorProcessor.access$000(ConstructorProcessor.java:28)
           at org.kohsuke.stapler.jsr269.ConstructorProcessor$1.visitExecutable(ConstructorProcessor.java:36)
           at org.kohsuke.stapler.jsr269.ConstructorProcessor$1.visitExecutable(ConstructorProcessor.java:32)
          Show
          sspringett Steve Springett added a comment - - edited Attempted to fix by introducing a second @DataBoundConstructor annotation that supported artifactType. Turns out that this is a known issue with Jenkins plugins. They are unable to do this due to known issues in third party components.   This is the output when compiling the plugin. When the secondary constructor is removed, it compiles properly.   javax.annotation.processing.FilerException: Attempt to reopen a file for path /Users/steve/Development/Dependency-Track/jenkins-plugin/target/classes/org/jenkinsci/plugins/DependencyTrack/DependencyTrackPublisher.stapler at com.sun.tools.javac.processing.JavacFiler.checkFileReopening(JavacFiler.java:535) at com.sun.tools.javac.processing.JavacFiler.createResource(JavacFiler.java:431) at org.kohsuke.stapler.jsr269.AbstractProcessorImpl.createResource(AbstractProcessorImpl.java:81) at org.kohsuke.stapler.jsr269.AbstractProcessorImpl.writePropertyFile(AbstractProcessorImpl.java:67) at org.kohsuke.stapler.jsr269.ConstructorProcessor.write(ConstructorProcessor.java:98) at org.kohsuke.stapler.jsr269.ConstructorProcessor.access$000(ConstructorProcessor.java:28) at org.kohsuke.stapler.jsr269.ConstructorProcessor$1.visitExecutable(ConstructorProcessor.java:36) at org.kohsuke.stapler.jsr269.ConstructorProcessor$1.visitExecutable(ConstructorProcessor.java:32)
          Hide
          sephirothj Ronny Perinke added a comment - - edited

          Next release will be v3.0.0 which removes this parameter completely.

          Show
          sephirothj Ronny Perinke added a comment - - edited Next release will be v3.0.0 which removes this parameter completely.

            People

            Assignee:
            sephirothj Ronny Perinke
            Reporter:
            msymons Mark Symons
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: