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

Artifact Resolver failed to expand tokens for [Artifact...

    Details

    • Similar Issues:

      Description

      after upgrading to 1.0 (Artifact Resolver plugin), the build is failing:

      [EnvInject] - Loading node environment variables.
      Building on master in workspace /appli/jenkins/jobs/COMMON-JAVA-ServletImpression_deploy_forms_app_dev_03-DEV/workspace
      [workspace] $ /bin/sh -xe /tmp/hudson8255542072747478763.sh
      + rm -f 'target/*'
      + grep SERVLET
      + env
      SERVLET_VERSION=1.4-SNAPSHOT
      SERVLET_ARTIFACT_URL=http://nexus.xxxx/nexus/content/groups/public/com/stef/soa/contratheque-soa/1.4-SNAPSHOT/contratheque-soa-1.4-SNAPSHOT.war
      SERVLET_ARTIFACT_ID=contratheque-soa
      SERVLET_GROUP_ID=com.stef.soa
      SERVLET_PACKAGING=war
      INFO: define repo: [Repository id=nexus-xxx, type=default, url=http://nexus.xxxx/nexus/content/groups/public/, isRepositoryManager=true]
      INFO: set authentication for jenkins
      failed to expand tokens for [Artifact ${SERVLET_GROUP_ID}:${SERVLET_ARTIFACT_ID}:${SERVLET_PACKAGING}::${SERVLET_VERSION}]
      java.lang.ClassCastException: eu.markov.jenkins.plugin.mvnmeta.MavenMetadataParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue
      at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183)
      at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127)
      at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
      at hudson.model.Run.execute(Run.java:1732)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:234)
      Build step 'Artifact Resolver' marked build as failure
      Archiving artifacts
      Finished: FAILURE

        Attachments

          Issue Links

            Activity

            Hide
            raphael_unique Raphaël UNIQUE added a comment -

            we use a parameter to choose the version to install
            and then the artifact deployer plugin can download it (in order to deploy a war after on a tomcat server)

            Show
            raphael_unique Raphaël UNIQUE added a comment - we use a parameter to choose the version to install and then the artifact deployer plugin can download it (in order to deploy a war after on a tomcat server)
            Hide
            hcguersoy hcguersoy added a comment -

            Hi,

            the same issue here, too.

            We use a parameter for the version field (which comes from ParametriziedTriggerPlugin). Now the build fails with a error that it can't cast from StringParameterValue to VersionParameterValue.

            We now downgraded to 0.8.2 as a workaround.

            Show
            hcguersoy hcguersoy added a comment - Hi, the same issue here, too. We use a parameter for the version field (which comes from ParametriziedTriggerPlugin). Now the build fails with a error that it can't cast from StringParameterValue to VersionParameterValue. We now downgraded to 0.8.2 as a workaround.
            Hide
            idapperdanman David Ishee added a comment -

            I'm seeing the same error too using parameters. Here is my stacktrace:

            java.lang.ClassCastException: hudson.model.StringParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183)
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127)
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101)
            	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
            	at hudson.model.Build$BuildExecution.build(Build.java:198)
            	at hudson.model.Build$BuildExecution.doRun(Build.java:159)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
            	at hudson.model.Run.execute(Run.java:1706)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:88)
            	at hudson.model.Executor.run(Executor.java:232)
            failed to expand tokens for [Artifact $MAVEN_GROUP:$ARTIFACT_ID:zip:dist-LMI:$VERSION]
            java.lang.ClassCastException: hudson.model.StringParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183)
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127)
            	at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101)
            	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756)
            	at hudson.model.Build$BuildExecution.build(Build.java:198)
            	at hudson.model.Build$BuildExecution.doRun(Build.java:159)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
            	at hudson.model.Run.execute(Run.java:1706)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:88)
            	at hudson.model.Executor.run(Executor.java:232)
            Build step 'Artifact Resolver' marked build as failure
            
            Show
            idapperdanman David Ishee added a comment - I'm seeing the same error too using parameters. Here is my stacktrace: java.lang.ClassCastException: hudson.model.StringParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756) at hudson.model.Build$BuildExecution.build(Build.java:198) at hudson.model.Build$BuildExecution.doRun(Build.java:159) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1706) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) failed to expand tokens for [Artifact $MAVEN_GROUP:$ARTIFACT_ID:zip:dist-LMI:$VERSION] java.lang.ClassCastException: hudson.model.StringParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:756) at hudson.model.Build$BuildExecution.build(Build.java:198) at hudson.model.Build$BuildExecution.doRun(Build.java:159) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529) at hudson.model.Run.execute(Run.java:1706) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:232) Build step 'Artifact Resolver' marked build as failure
            Hide
            ydelanoe Yann DELANOE added a comment -

            Same issue after having upgraded in 1.0
            Even if the version is a number not comming from a parameter:

            INFO: define repo: [Repository id=nexus, type=default, url=http://xxxxxx/nexus/content/repositories/, isRepositoryManager=true]
            failed to expand tokens for [Artifact releases.com.xxxxxx.xxxxxxxxxxxxx:XXXXXXXXXXXX:tar.gz::5.0.0]
            java.lang.ClassCastException: hudson.model.BooleanParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue
            at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183)
            at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127)
            at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101)
            at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
            at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
            at hudson.model.Build$BuildExecution.build(Build.java:199)
            at hudson.model.Build$BuildExecution.doRun(Build.java:160)
            at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
            at hudson.model.Run.execute(Run.java:1740)
            at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            at hudson.model.ResourceController.execute(ResourceController.java:88)
            at hudson.model.Executor.run(Executor.java:234)
            Build step 'Artifact Resolver' marked build as failure
            Finished: FAILURE

            Show
            ydelanoe Yann DELANOE added a comment - Same issue after having upgraded in 1.0 Even if the version is a number not comming from a parameter: INFO: define repo: [Repository id=nexus, type=default, url=http://xxxxxx/nexus/content/repositories/, isRepositoryManager=true] failed to expand tokens for [Artifact releases.com.xxxxxx.xxxxxxxxxxxxx:XXXXXXXXXXXX:tar.gz::5.0.0] java.lang.ClassCastException: hudson.model.BooleanParameterValue cannot be cast to org.jvnet.hudson.plugins.repositoryconnector.VersionParameterValue at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.checkVersionOverride(ArtifactResolver.java:183) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.download(ArtifactResolver.java:127) at org.jvnet.hudson.plugins.repositoryconnector.ArtifactResolver.perform(ArtifactResolver.java:101) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:160) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535) at hudson.model.Run.execute(Run.java:1740) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:234) Build step 'Artifact Resolver' marked build as failure Finished: FAILURE
            Hide
            sboniello Stephen B added a comment -

            I'm having the same issue. I have a parameterized build, but the Artifact Resolver Build step isn't taking in any of those parameters.

            Show
            sboniello Stephen B added a comment - I'm having the same issue. I have a parameterized build, but the Artifact Resolver Build step isn't taking in any of those parameters.
            Hide
            dejan2609 Dejan Stojadinović added a comment - - edited

            I just tested Artifact Resolver 1.0.0 and I can confirm Yann DELANOE: issue occurs for "hardcoded" versions also.

            Show
            dejan2609 Dejan Stojadinović added a comment - - edited I just tested Artifact Resolver 1.0.0 and I can confirm Yann DELANOE : issue occurs for "hardcoded" versions also.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: imod
            Path:
            src/main/java/org/jvnet/hudson/plugins/repositoryconnector/ArtifactResolver.java
            src/test/java/org/jvnet/hudson/plugins/repositoryconnector/ArtifactDownloadTest.java
            http://jenkins-ci.org/commit/repository-connector-plugin/34e4846257fcde46e4ee314a8df7f700a3cb7075
            Log:
            [FIXED JENKINS-23946] Artifact Resolver failed to expand tokens

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: imod Path: src/main/java/org/jvnet/hudson/plugins/repositoryconnector/ArtifactResolver.java src/test/java/org/jvnet/hudson/plugins/repositoryconnector/ArtifactDownloadTest.java http://jenkins-ci.org/commit/repository-connector-plugin/34e4846257fcde46e4ee314a8df7f700a3cb7075 Log: [FIXED JENKINS-23946] Artifact Resolver failed to expand tokens
            Hide
            domi Dominik Bartholdi added a comment -

            released as 1.0.1

            Show
            domi Dominik Bartholdi added a comment - released as 1.0.1
            Hide
            legall_benoit Benoit Le Gall added a comment -

            the new version 1.0.1 erase the configuration of the Artifact Resolver :'(

            Show
            legall_benoit Benoit Le Gall added a comment - the new version 1.0.1 erase the configuration of the Artifact Resolver :'(
            Hide
            domi Dominik Bartholdi added a comment -

            when upgrading from "1.0.0 to 1.0.1" or "0.8.2 to 1.0.1"?
            can you please open a new ticket with some more details?

            Show
            domi Dominik Bartholdi added a comment - when upgrading from "1.0.0 to 1.0.1" or "0.8.2 to 1.0.1"? can you please open a new ticket with some more details?
            Hide
            legall_benoit Benoit Le Gall added a comment -

            when updating from O.8.2 to 1.0.0 then 1.0.0 to 1.0.1.
            As for more details : the configuration of the part Artifact Resolver is reseted, without the custom repositories

            Show
            legall_benoit Benoit Le Gall added a comment - when updating from O.8.2 to 1.0.0 then 1.0.0 to 1.0.1. As for more details : the configuration of the part Artifact Resolver is reseted, without the custom repositories

              People

              • Assignee:
                imod Dominik Bartholdi
                Reporter:
                raphael_unique Raphaël UNIQUE
              • Votes:
                5 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: