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

Correct Pom for build-monitor-plugin

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: build-monitor-plugin
    • Labels:
      None
    • Environment:
      Jenkins-2.32.3
      gradle - 2.12
      build-monitor-plugin-1.11+build.201701152243
      job-dsl-plugin - 1.58
    • Similar Issues:

      Description

      We run tests against our job-dsl code using gradle before kicking off the dsl processing job. For dsl code referencing various plugins, we include the dependancies via build.gradle

      dependancies {
         testPlugins 'org.jenkins-ci.main:maven-plugin:2.3'
      }

      when including build-monitor-plugin:
      testPlugins 'org.jenkins-ci.plugins:build-monitor-plugin:1.11+build.201701152243'

      I get an error saying:
      > Could not resolve org.jenkins-ci.plugins:build-monitor-plugin:1.11+build.201701152243.
      > Could not parse POM http://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/build-monitor-plugin/1.11+build.201701152243/build-monitor-plugin-1.11+build.201701152243.pom
      > Could not find org.jenkins-ci.plugins:build-monitor:1.11+build.201701152243.

      After a little digging, it appears the pom is not set-up per https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-pom.xml

      I was able to add the pom & hpi to our local repository and successfully got the tests running by making the following changes:

      <parent>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>plugin</artifactId>
      <version>1.609.3</version>
      </parent>

      This was set to <artifactId>build-monitor</artifactId> - which doesn't seem to exist.

      With the required jenkins version in the correct place (the parent), a separate verison tag needs to be added:
      <version>1.11+build.201701152243</version>

      A version for the hamcrest dependancy was needed for it to be correctly found

      <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>3.1</version>
      <scope>test</scope>
      </dependency>

        Attachments

          Activity

          Hide
          daspilker Daniel Spilker added a comment -

          This is not a Job DSL issue.

          Show
          daspilker Daniel Spilker added a comment - This is not a Job DSL issue.
          Hide
          eddgrant Edd Grant added a comment -

          This is affecting us too. Whilst I agree with Daniel Spilker that it is not directly a Job DSL issue, it does manifest when trying to write Job DSL tests, since following the Testing DSL Scripts guidance and trying to resolve this plugin causes this issue to manifest.

          Would it be possible to get the maintainer of the build-monitor-plugin to make the necessary changes to the POM to fix this issue? It sounds like the steps are well laid out above and it would stop others from hitting this issue (I've just spent a good couple of hours trying to figure out what was wrong).

          Show
          eddgrant Edd Grant added a comment - This is affecting us too. Whilst I agree with Daniel Spilker that it is not directly a Job DSL issue, it does manifest when trying to write Job DSL tests, since following the Testing DSL Scripts guidance and trying to resolve this plugin causes this issue to manifest. Would it be possible to get the maintainer of the build-monitor-plugin to make the necessary changes to the POM to fix this issue? It sounds like the steps are well laid out above and it would stop others from hitting this issue (I've just spent a good couple of hours trying to figure out what was wrong).
          Hide
          daspilker Daniel Spilker added a comment -

          Has anyone tested the lasted version v1.12+build.201708172343? The POM seems to be fixed.

          Show
          daspilker Daniel Spilker added a comment - Has anyone tested the lasted version v1.12+build.201708172343? The POM seems to be fixed.
          Hide
          eddgrant Edd Grant added a comment -

          Hey Daniel Spilker,

          Yep we originally tested that build as it happens, double checked it again this morning and got the same error:

             > Could not resolve org.jenkins-ci.plugins:build-monitor-plugin:1.12+build.201708172343.
                > Could not parse POM https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/build-monitor-plugin/1.12+build.201708172343/build-monitor-plugin-1.12+build.201708172343.pom
                   > Could not find org.jenkins-ci.plugins:build-monitor:1.12+build.201708172343.
             > Could not resolve org.jenkins-ci.plugins:build-monitor-plugin:1.12+build.201708172343.
                > Could not parse POM https://nexus-build.tax.service.gov.uk/content/groups/public/org/jenkins-ci/plugins/build-monitor-plugin/1.12+build.201708172343/build-monitor-plugin-1.12+build.201708172343.pom
                   > Could not find org.jenkins-ci.plugins:build-monitor:1.12+build.201708172343.
          

          Interestingly I cloned the build-monitor-plugin repository, changed the version to 1.12-SNAPSHOT and ran a mvn install. I then was able to get Gradle to use this artefact just fine by using mavenLocal(). This confused me as I was expecting to get the same error I got when pulling the official artefact, could it be that there's something going on in the publishing phase which is modifying the pom?

          Cheers!

          Show
          eddgrant Edd Grant added a comment - Hey Daniel Spilker , Yep we originally tested that build as it happens, double checked it again this morning and got the same error: > Could not resolve org.jenkins-ci.plugins:build-monitor-plugin:1.12+build.201708172343. > Could not parse POM https: //repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/build-monitor-plugin/1.12+build.201708172343/build-monitor-plugin-1.12+build.201708172343.pom > Could not find org.jenkins-ci.plugins:build-monitor:1.12+build.201708172343. > Could not resolve org.jenkins-ci.plugins:build-monitor-plugin:1.12+build.201708172343. > Could not parse POM https: //nexus-build.tax.service.gov.uk/content/groups/ public /org/jenkins-ci/plugins/build-monitor-plugin/1.12+build.201708172343/build-monitor-plugin-1.12+build.201708172343.pom > Could not find org.jenkins-ci.plugins:build-monitor:1.12+build.201708172343. Interestingly I cloned the build-monitor-plugin repository, changed the version to 1.12-SNAPSHOT and ran a mvn install . I then was able to get Gradle to use this artefact just fine by using mavenLocal() . This confused me as I was expecting to get the same error I got when pulling the official artefact, could it be that there's something going on in the publishing phase which is modifying the pom? Cheers!
          Hide
          sverhoef Stefan Verhoeff added a comment -

          We have the same issue, using the build-monitor-plugin as dependency with Gradle. It's reported to the project's GitHub project: https://github.com/jan-molak/jenkins-build-monitor-plugin/issues/373

          Show
          sverhoef Stefan Verhoeff added a comment - We have the same issue, using the build-monitor-plugin as dependency with Gradle. It's reported to the project's GitHub project: https://github.com/jan-molak/jenkins-build-monitor-plugin/issues/373

            People

            • Assignee:
              Unassigned
              Reporter:
              cruhl Chaz Ruhl
            • Votes:
              4 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: