You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2009/01/19 17:10:55 UTC

DO NOT REPLY [Bug 46561] New: Running Ant from command line fails if property contains a comma

https://issues.apache.org/bugzilla/show_bug.cgi?id=46561

           Summary: Running Ant from command line fails if property contains
                    a comma
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: mark.melvin@gmail.com


If I run the following command line (on Windows XP and Windows Server 2003):

ant.bat -Da.property=1,2,3

This fails with the message:

Target "2" does not exist in the project "test".

If I run Java with a similar command line, the property "a.property" is set to
the expected value of "1,2,3".

Note that I can get Ant to succeed by double-quoting the entire argument as
follows:

ant.bat "-Da.property=1,2,3"

However, this should not be necessary.  And in fact, it is not always
practical.   I am running into an insurmountable issue where Ant is being
called from my build server, and the build server constructs the command line. 
I need a property set on the command line that contains a comma and I have no
control over command line argument creation.  

Is there another way I can work around this?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46561] Running Ant from command line fails if property contains a comma

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46561





--- Comment #2 from Mark Melvin <ma...@gmail.com>  2009-01-19 11:03:38 PST ---
Well, I think things could be worked around in Ant.bat as you are exposing the
shell's argument weaknesses by rebuilding all the args using SHIFT.  This
forces you to accept the result - which is that the DOS prompt splits arguments
on all delimiters.  If you didn't use SHIFT you would not have the problem.  


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46561] Running Ant from command line fails if property contains a comma

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46561


Dominique Devienne <dd...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Dominique Devienne <dd...@gmail.com>  2009-01-19 09:29:05 PST ---
Sorry, but this is not a bug. The command shell (DOS) in this case is the one
interpreting the command line before Ant sees it, and the quoting to be done is
Shell dependent.

We can't do anything about this. --DD


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 46561] Running Ant from command line fails if property contains a comma

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46561





--- Comment #3 from Dominique Devienne <dd...@gmail.com>  2009-01-19 15:59:48 PST ---
If you can provide a functionally equivalent ant.bat which does not exhibit the
issue you reported regarding comma handling, we'd gladly take it, although the
Ant team is quite reticent to ant.bat changes in general since they tend to be
so brittle, as you probably well know since you mention DOS' weakness in the
domain.

Maybe you can substitute ant.bat for a .bat of your own doing?


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.