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

The Manifest of the job-dsl JAR is empty, making it unuseable for tests

      Hi,

      I'm using the Job DSL plug-in from another plug-in, and need to use it for my integration tests as well:

      dependencies {
          ...
          jenkinsPlugins 'org.jenkins-ci.plugins:job-dsl:1.32@jar'
          ...
      }
      

      I'm using the JenkinsRule and it fails because it cannot resolve job-dsl:1.32. After looking into the code of JenkinsRule, I've seen that the JAR location is fetched using Manifest information, in the Short-Name attribute.

      Although this information is filled in correctly in the JPI file, it is absent in the JAR file. I had a look at other plug-ins, and the manifest information is generated for both the JAR and the HPI/JPI file. So it might have something to do with the Gradle JPI plug-in.

      In order to make the Job DSL plug-in useable from other plug-ins, especially in their integration tests using the JenkinsRule, the JAR needs the Manifest information.

      Best regards,
      Damien.

          [JENKINS-27994] The Manifest of the job-dsl JAR is empty, making it unuseable for tests

          Hi,

          I've created a pull request which solves this problem:

          https://github.com/jenkinsci/gradle-jpi-plugin/pull/50

          If accepted, the new version of the gradle-jpi-plugin should be applied to job-dsl and new version of the plug-in created.

          Best regards,
          Damien.

          Damien Coraboeuf added a comment - Hi, I've created a pull request which solves this problem: https://github.com/jenkinsci/gradle-jpi-plugin/pull/50 If accepted, the new version of the gradle-jpi-plugin should be applied to job-dsl and new version of the plug-in created. Best regards, Damien.

          Code changed in jenkins
          User: Damien Coraboeuf
          Path:
          src/main/groovy/org/jenkinsci/gradle/plugins/jpi/Jpi.groovy
          src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiManifest.groovy
          src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiPlugin.groovy
          src/test/groovy/org/jenkinsci/gradle/plugins/jpi/JpiManifestSpec.groovy
          http://jenkins-ci.org/commit/gradle-jpi-plugin/ee38a8f14a7a1702c76a441fa9fc78c62deee8af
          Log:
          JENKINS-27994 Adding the manifest in the JAR

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Damien Coraboeuf Path: src/main/groovy/org/jenkinsci/gradle/plugins/jpi/Jpi.groovy src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiManifest.groovy src/main/groovy/org/jenkinsci/gradle/plugins/jpi/JpiPlugin.groovy src/test/groovy/org/jenkinsci/gradle/plugins/jpi/JpiManifestSpec.groovy http://jenkins-ci.org/commit/gradle-jpi-plugin/ee38a8f14a7a1702c76a441fa9fc78c62deee8af Log: JENKINS-27994 Adding the manifest in the JAR

          Released in 0.11.0.

          Daniel Spilker added a comment - Released in 0.11.0.

          Thanks Daniel. Do I create a PR for the Job DSL plugin to take this version into account, or do you do it?

          Damien Coraboeuf added a comment - Thanks Daniel. Do I create a PR for the Job DSL plugin to take this version into account, or do you do it?

          Daniel Spilker added a comment - I already did, it's part of https://github.com/jenkinsci/job-dsl-plugin/pull/464

            daspilker Daniel Spilker
            damien_coraboeuf Damien Coraboeuf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: