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

Collapsing of double backslash now that quotes are supported in maven options

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Platform: All, OS: Windows XP

      In a maven 2 project, if I add a property in the m2 options whose value is
      surronded by double-quotes (because the value contains spaces) the invocation of
      m2 fails just as if the quotes where removed.
      For instance if my options are: install -Dmy.property="my value", then m2 fails
      because "value" is not a valid goal.

      Note that the freestyle projects treat quotes properly.


      Reopen: Issue was reopened because added quote support affects backslashes. Double-backslash now gets collapsed to one.. see comments below.

          [JENKINS-2584] Collapsing of double backslash now that quotes are supported in maven options

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/util/ArgumentListBuilder.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=13014
          Log:
          [FIXED JENKINS-2584]
          Fixed tokenization handling in command line that involves quotes (like <tt>-Dabc="abc def"</tt>.

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/util/ArgumentListBuilder.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=13014 Log: [FIXED JENKINS-2584] Fixed tokenization handling in command line that involves quotes (like <tt>-Dabc="abc def"</tt>.

          See http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html for
          a regression this caused on Windows systems.

          Kohsuke Kawaguchi added a comment - See http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html for a regression this caused on Windows systems.

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/util/QuotedStringTokenizer.java
          trunk/hudson/main/core/src/test/java/hudson/util/QuotedStringTokenizerTest.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=13297
          Log:
          JENKINS-2584 Fixed a regression introduced in 1.260.
          Also see http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/util/QuotedStringTokenizer.java trunk/hudson/main/core/src/test/java/hudson/util/QuotedStringTokenizerTest.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=13297 Log: JENKINS-2584 Fixed a regression introduced in 1.260. Also see http://www.nabble.com/Error-parsing-%22-in-msbuild-task-to20535754.html

          lloydskoyd added a comment -

          Using Hudson 1.265, I am seeing an issue where double backslashes (
          ) are
          reduced to a single backslash (). Using the following goal:

          dependency:copy -Dmy.directory=\\vm\Update

          ...the value of the "my.directory" property is interpreted as "\vm\Update".
          Reverting to 1.259 resolves \ related issues as the fix in 1.263 appears to be
          the cause.

          lloydskoyd added a comment - Using Hudson 1.265, I am seeing an issue where double backslashes ( ) are reduced to a single backslash (). Using the following goal: dependency:copy -Dmy.directory=\\vm\Update ...the value of the "my.directory" property is interpreted as "\vm\Update". Reverting to 1.259 resolves \ related issues as the fix in 1.263 appears to be the cause.

          Paul Nyheim added a comment -

          We are also experiencing this issue with the NantBuilder in a free-style
          software project.

          The Nant targets we are passing into hudson are:
          -D:publishdir=\\servername\folder\subfolder\ nantTarget

          I notice a couple of issues with this.
          1. Double backslash is reduced to single backslash
          2. Trailing backslash is removed
          3. nantTarget is interpreted as part of the path

          I'll try to create a testcase that illustrates these problems.

          Paul Nyheim added a comment - We are also experiencing this issue with the NantBuilder in a free-style software project. The Nant targets we are passing into hudson are: -D:publishdir=\\servername\folder\subfolder\ nantTarget I notice a couple of issues with this. 1. Double backslash is reduced to single backslash 2. Trailing backslash is removed 3. nantTarget is interpreted as part of the path I'll try to create a testcase that illustrates these problems.

          Paul Nyheim added a comment -

          Created an attachment (id=499)
          Testcase for trailing backslash and reduced double backslash

          Paul Nyheim added a comment - Created an attachment (id=499) Testcase for trailing backslash and reduced double backslash

          Paul Nyheim added a comment -

          Hi.
          I have uploaded a test case (ArgumentListBuilderTest). This test case works fine
          for 1.259, and fails for 1.260 (and trunk).

          Digging into it I notice that it has to do with the way that
          QuotedStringTokenizer works, so maybe the tests should be added to
          QuotedStringTokenizerTestCase instead, but I don't know if that is the way it is
          intended to be or not.

          What I am sure about is that it should not be necessary for me to escape my
          backslashes in my paths in the Hudson GUI when I set up the Nant task.

          Regards,
          Paul

          Paul Nyheim added a comment - Hi. I have uploaded a test case (ArgumentListBuilderTest). This test case works fine for 1.259, and fails for 1.260 (and trunk). Digging into it I notice that it has to do with the way that QuotedStringTokenizer works, so maybe the tests should be added to QuotedStringTokenizerTestCase instead, but I don't know if that is the way it is intended to be or not. What I am sure about is that it should not be necessary for me to escape my backslashes in my paths in the Hudson GUI when I set up the Nant task. Regards, Paul

          Alan Harder added a comment -

          lloydskoyd,pnyheim-
          Now that quotes are supported, there is shell-like escaping.. so you can do something like "the \"value\" is here". So everything should work ok if you double-up all your backslashes. This question is, can we just document this somewhere, or should this be considered a bug?

          Alan Harder added a comment - lloydskoyd,pnyheim- Now that quotes are supported, there is shell-like escaping.. so you can do something like "the \"value\" is here" . So everything should work ok if you double-up all your backslashes. This question is, can we just document this somewhere, or should this be considered a bug?

          Alan Harder added a comment -

          updated issue summary to indicate the reason it was reopened.

          Alan Harder added a comment - updated issue summary to indicate the reason it was reopened.

            Unassigned Unassigned
            gdurand gdurand
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: