cjo9900 commented on Bug JENKINS-15886

After seeing that you are using Windows to build I set up a windows Node and built my test project from there and see the same thing, and some other strange side effects when selecting different builds to copy from.

Windows only.
Selecting "Specific Build" fails

[test] $ cmd.exe /C '"c:\jenkins\tools\Ant\1.8.4\bin\ant.bat -file build.xml "-DBUILD_SELECTOR=<SpecificBuildSelector plugin=""copyartifact@1.25"">  <buildNumber>2</buildNumber></SpecificBuildSelector>" clean jar && exit %%ERRORLEVEL%%"'
Buildfile: c:\jenkins\workspace\ant\test\build.xml

BUILD FAILED
Target "<buildNumber>2</buildNumber></SpecificBuildSelector> clean jar" does not exist in the project "HelloWorld".

Same behaviour occurs when selecting the Perma link

[test] $ cmd.exe /C '"c:\jenkins\tools\Ant\1.8.4\bin\ant.bat -file build.xml "-DBUILD_SELECTOR=<PermalinkBuildSelector plugin=""copyartifact@1.25"">  <id>lastFailedBuild</id></PermalinkBuildSelector>" clean jar && exit %%ERRORLEVEL%%"'
Buildfile: c:\jenkins\workspace\ant\test\build.xml

BUILD FAILED
Target "<id>lastFailedBuild</id></PermalinkBuildSelector> clean jar" does not exist in the project "HelloWorld".

Selecting "Status Build" this runs default target as first raised

[test] $ cmd.exe /C '"c:\jenkins\tools\Ant\1.8.4\bin\ant.bat -file build.xml "-DBUILD_SELECTOR=<StatusBuildSelector plugin=""copyartifact@1.25""/>" clean jar && exit %%ERRORLEVEL%%"'
Buildfile: c:\jenkins\workspace\ant\test\build.xml

clean:
   [delete] Deleting directory c:\jenkins\workspace\ant\test\build

compile:
    [mkdir] Created dir: c:\jenkins\workspace\ant\test\build\classes
    [javac] c:\jenkins\workspace\ant\test\build.xml:19: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
    [javac] Compiling 1 source file to c:\jenkins\workspace\ant\test\build\classes

jar:
    [mkdir] Created dir: c:\jenkins\workspace\ant\test\build\jar
      [jar] Building jar: c:\jenkins\workspace\ant\test\build\jar\HelloWorld.jar

run:
     [java] Hello World

main:

BUILD SUCCESSFUL
Total time: 2 seconds

As you can see the strange effects come from the quoting used to pass the variables to the command.

In this case I think that the Copy Artifact Plugin that provides this parameter should be changed so that it is not passed as a string Parameter value. It should really create its own ParameterValue type that does not contribute to the Environment so that these issues do not occur, as in 90% of the cases the parameter is only useful to the copy artifact build step.
(Can't think of others that use it, but I think there might be.)

Therefore setting this to the Copy Artifact Plugin

Will have a look at it when I have time, and to see if changes can be made.
Chris

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to