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

Parameter value with '<', '>' are not properly escaped when launching mvn

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • maven-plugin
    • None
    • Windows

      I have a 2-step build process:
      1. Copy artifact from another project
      2. Invoke top-level Maven artifact

      I'm using parameterized build with a "Build selector for Copy Artifact" (parameter name: which_build).

      When I start the build and select "Latest successful build" option with "Stable build only" unchecked the generated parameter value will not be escaped for Maven command line and the build fails (on Windows):

      "e:\Program Files\apache-maven-3.0.3\bin\mvn.bat" -Dwhich_build=<StatusBuildSelector/> -e ...

      When I have "Stable build only" checked, the build runs fine as the following command line is used with XML tags correctly escaped:

      "e:\Program Files\apache-maven-3.0.3\bin\mvn.bat" "-Dwhich_build=<StatusBuildSelector> <stable>true</stable></StatusBuildSelector>" -e ...


      (Noted added by ikedam)
      This can be reproduced without copyartifact plugin:

      1. Create a new free style project "mavenbuildertest"
      2. Check "This build is parameterized"
      3. Add "String Parameter":
        • Name: which_build
        • Default Value: <StatusBuildSelector/>
      4. Add "Invoke top-level Maven targets"
      5. Trigger build and it results in calling following command:
        [mavenbuildertest] $ mvn.bat -Dwhich_build=<StatusBuildSelector/>
        The syntax of the command is incorrect.
        

            Unassigned Unassigned
            ambro23 Milan Farkas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: