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

Cannot use Incrementals from pom.xml

XMLWordPrintable

      Given a local settings file with

          <mirrors>
              <mirror>
                  <id>...</id>
                  <url>...</url>
                  <mirrorOf>*,!repo.jenkins-ci.org,!incrementals,...</mirrorOf>
              </mirror>
          </mirrors>
      

      I tried patching jenkins-x/jenkins-x-serverless as follows:

      diff --git a/pom.xml b/pom.xml
      index 3d39c8b..6ddd38b 100644
      --- a/pom.xml
      +++ b/pom.xml
      @@ -173,7 +173,7 @@
           <dependency>
             <groupId>org.jenkins-ci.plugins.workflow</groupId>
             <artifactId>workflow-durable-task-step</artifactId>
      -      <version>2.27</version>
      +      <version>2.29-rc877.225ff33f21fd</version>
           </dependency>
           <dependency>
             <groupId>org.jenkins-ci.plugins.workflow</groupId>
      @@ -242,6 +242,10 @@
             <id>repo.jenkins-ci.org</id>
             <url>https://repo.jenkins-ci.org/public/</url>
           </repository>
      +    <repository>
      +      <id>incrementals</id>
      +      <url>https://repo.jenkins-ci.org/incrementals/</url>
      +    </repository>
         </repositories>
         <pluginRepositories>
           <pluginRepository>
      

      and ran make. This did not proceed as expected:

      > > rm -rf tmp
      mvn clean install
      [INFO] Scanning for projects...
      [INFO] 
      [INFO] -------------------< io.jenkins-x.serverless:parent >-------------------
      [INFO] Building plugin-dependencies 1.0-SNAPSHOT
      [INFO] --------------------------------[ jar ]---------------------------------
      Downloading from incrementals: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.pom
      Downloaded from incrementals: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.pom (6.3 kB at 11 kB/s)
      Downloading from incrementals: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.jar
      Downloaded from incrementals: https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.jar (104 kB at 435 kB/s)
      [INFO] 
      ...
      INFO: Checking /home/jglick/.m2/repository/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.hpi
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:get (default-cli) on project standalone-pom: Couldn't download artifact: Could not find artifact org.jenkins-ci.plugins.workflow:workflow-durable-task-step:hpi:2.29-rc877.225ff33f21fd in ... (...)
      [ERROR] 
      [ERROR] Try downloading the file manually from the project website.
      [ERROR] 
      [ERROR] Then, install it using the command: 
      [ERROR]     mvn install:install-file -DgroupId=org.jenkins-ci.plugins.workflow -DartifactId=workflow-durable-task-step -Dversion=2.29-rc877.225ff33f21fd -Dpackaging=hpi -Dfile=/path/to/file
      [ERROR] 
      [ERROR] Alternatively, if you host your own repository you can deploy the file there: 
      [ERROR]     mvn deploy:deploy-file -DgroupId=org.jenkins-ci.plugins.workflow -DartifactId=workflow-durable-task-step -Dversion=2.29-rc877.225ff33f21fd -Dpackaging=hpi -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
      [ERROR] 
      [ERROR] 
      [ERROR]   org.jenkins-ci.plugins.workflow:workflow-durable-task-step:hpi:2.29-rc877.225ff33f21fd
      [ERROR] 
      [ERROR] from the specified remote repositories:
      [ERROR]   ... (..., releases=true, snapshots=true)
      [ERROR] -> [Help 1]
      [ERROR] 
      [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
      [ERROR] Re-run Maven using the -X switch to enable full debug logging.
      [ERROR] 
      [ERROR] For more information about the errors and possible solutions, please read the following articles:
      [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
      Jan 28, 2019 9:05:13 AM io.jenkins.tools.warpackager.lib.util.MavenHelper artifactExists
      INFO: Could not download org.jenkins-ci.plugins.workflow:workflow-durable-task-step:2.29-rc877.225ff33f21fd, assuming it is not an HPI and creating /home/jglick/.m2/cwp_non_hpi_cache/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.29-rc877.225ff33f21fd/workflow-durable-task-step-2.29-rc877.225ff33f21fd.hpi to remember the assumption.
      Jan 28, 2019 9:05:13 AM io.jenkins.tools.warpackager.lib.config.Config processMavenDep
      INFO: Skipping dependency, not an HPI file: org.jenkins-ci.plugins.workflow:workflow-durable-task-step:2.29-rc877.225ff33f21fd
      ...
      [INFO] Installing artifact /home/jglick/.m2/repository/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.9/workflow-durable-task-step-2.9.jar to /.../jenkins-x-serverless/tmp/build/jenkinsfile-runner/app/target/appassembler/repo/org/jenkins-ci/plugins/workflow/workflow-durable-task-step/2.9/workflow-durable-task-step-2.9.jar
      ...
      

      First of all, MavenHelper.run failed to use the <repository> declaration specified in my pom.xml, because it was running mvn in some other directory, I do not know why. (The simpler trick I have used elsewhere does not suffer from this problem.) Then it proceeded despite the error, producing a bogus image with some older version of the plugin!

         3.750 [id=22]	SEVERE	jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin Pipeline: Declarative v1.3.4.1 (pipeline-model-definition)
      java.io.IOException: Pipeline: Declarative v1.3.4.1 failed to load.
       - Pipeline: Nodes and Processes v2.8 is older than required. To fix, install v2.15 or later.
      	at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:652)
      	at ...
      

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: