Using file paths with spaces in config xml (for ant)

1,648 views
Skip to first unread message

Mitchell Tulley

unread,
Apr 28, 2015, 11:17:59 AM4/28/15
to go...@googlegroups.com
Hi,

I am trying to point ant to a specific property file via config xml.

The path to the property file contains spaces.

The problem I am having is that double quotes are already used for target="..." but I also need them for the filepath.

When I try to build the project I get the following error:

[go] Start to execute task: <ant target="-propertyfile=C:\Program Files (x86)\Go Agent\pipelines\ProjectX\nbproject\go.properties" />. 

Could not load property file C:\Program: C:\Program (The system cannot find the file specified)
Buildfile: C:\Program Files (x86)\Go Agent\pipelines\ProjectX\build.xml

BUILD FAILED
Target "Files" does not exist in the project "ProjectX".

Any suggestions? ( other than moving the directory to one with no spaces :D )
Many Thanks,

Mitchell.

Aravind SV

unread,
Apr 28, 2015, 11:50:18 AM4/28/15
to Mitchell Tulley, go...@googlegroups.com
Have you tried it with a double quote?

The XML looks something like this:

<tasks>
  <ant target="-propertyfile=&quot;C:\Dir With Spaces\SomeFile.xml&quot;" />
</tasks>

and in the UI, it looks like this:

Inline image 1

I don't have a Windows box handy to try this.

Cheers,
Aravind

--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mitchell Tulley

unread,
Apr 29, 2015, 3:56:36 AM4/29/15
to go...@googlegroups.com, mitchel...@googlemail.com
Hi Aravind,


I get the following error:

You must specify a property filename when using the -propertyfile argument

When using double quotes in the image below:


The XML:

<stage name="BuildStage">
        <jobs>
          <job name="BuildJob">
            <tasks>
              <ant target="-propertyfile=&quot;C:\Program Files (x86)\Go Agent\pipelines\ProjectX\nbproject\go.properties&quot;">
                <runif status="passed" />
              </ant>
            </tasks>
          </job>
        </jobs>
      </stage>
I can confirm the file exists using the filepath in the image and XML.

Mitchell.

Mitchell Tulley

unread,
Apr 29, 2015, 5:47:44 AM4/29/15
to go...@googlegroups.com
I've decided to move it to C:\GoAgent, the spaces are causing me too many problems.
Reply all
Reply to author
Forward
0 new messages