It's all about the answers!

Ask a question

Build Definition with spaces in Working Dir path


mike brosnan (1011213) | asked Dec 09 '10, 5:30 a.m.
I'm setting up a build definition for a build on Windows.

It's using the command line - Jazz Source Control build definition template.

The problem I'm having is that the working dir has spaces.

I tried enclosing the path in quotes but that doesn't work.

Are there any solutions to this other than the obvious one of inserting underscores instead of spaces?

Mike Brosnan

7 answers



permanent link
Nick Edgar (6.5k711) | answered Dec 09 '10, 2:42 p.m.
JAZZ DEVELOPER
It should be OK if the working dir has spaces. Does the command line also have spaces?

permanent link
David Lafreniere (4.8k7) | answered Dec 09 '10, 4:21 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
The problem I'm having is that the working dir has spaces.

I tried enclosing the path in quotes but that doesn't work.

Mike Brosnan


I tried making a "Command Line - Jazz Build Engine" Build Definition and I was able to run a successful build when specifying a working directory which contains spaces.

Ex:
Command: cmd /c dir
Working directory: c:\dir with spaces (with no quotes)


As Nick said, is it possible your command has spaces?

As an example, the following command would fail (even though I do have a directory called "dir with spaces").
Command: cmd /c dir c:\dir with spaces

To get this command to work in Windows you would have to do this:
Command: cmd /c dir "c:\dir with spaces"

Please provide additional information as to what your command is, and what are the errors you are receiving.

permanent link
mike brosnan (1011213) | answered Dec 09 '10, 4:49 p.m.
The problem I'm having is that the working dir has spaces.

I tried enclosing the path in quotes but that doesn't work.

Mike Brosnan


I tried making a "Command Line - Jazz Build Engine" Build Definition and I was able to run a successful build when specifying a working directory which contains spaces.

Ex:
Command: cmd /c dir
Working directory: c:\dir with spaces (with no quotes)


As Nick said, is it possible your command has spaces?

As an example, the following command would fail (even though I do have a directory called "dir with spaces").
Command: cmd /c dir c:\dir with spaces

To get this command to work in Windows you would have to do this:
Command: cmd /c dir "c:\dir with spaces"

Please provide additional information as to what your command is, and what are the errors you are receiving.


The directory I was specifying in the Working Directory was on the D: drive, and the build engine is set up on the default path on C:.

I'll try that again on the C: drive with quotes as you suggest,

We're on RTC 2.0.0.2.iFix4

thanks

Mike

permanent link
mike brosnan (1011213) | answered Dec 10 '10, 6:33 a.m.
I tested this again.

I'm just using cmd /c dir as the command.

I can add "C:\Documents and Settings" on the command line, or in the Arguments field in the build definition and that works fine

When I use "C:\Documents and Settings" in the Working Directory field, it fails with the following message

2010-12-10 06:28:41 running on host: EI0085VWIN
2010-12-10 06:28:41 Should build occur?
2010-12-10 06:28:41 Yes: Always build a user initiated request.
2010-12-10 06:28:42 Invoking pre-build participant "com.ibm.team.build.jazzscm"
Accepting changes into workspace "a449909 Toolkits DNC Stream Workspace" ...
Fetching files to fetch destination "C:\RTCBUILD\DNC\DNC\DNC" ...
2010-12-10 06:28:47 Invoking build participant "com.ibm.team.build.cmdline"
java.io.IOException: The filename, directory name, or volume label syntax is incorrect.
at java.io.Win32FileSystem.canonicalize(Win32FileSystem.java:434)
at java.io.File.getCanonicalPath(File.java:560)
at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.getMissingWorkingDirException(CommandLineBuildParticipant.java:360)
at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.getWorkingDirectory(CommandLineBuildParticipant.java:349)
at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.validateWorkingDir(CommandLineBuildParticipant.java:125)
at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.validateProperties(CommandLineBuildParticipant.java:106)
at com.ibm.team.build.internal.engine.CommandLineBuildParticipant.build(CommandLineBuildParticipant.java:71)
at com.ibm.team.build.internal.engine.BuildLoop.invokeBuildParticipants(BuildLoop.java:655)
at com.ibm.team.build.internal.engine.BuildLoop$2.run(BuildLoop.java:468)
at java.lang.Thread.run(Thread.java:811)

permanent link
Nick Edgar (6.5k711) | answered Dec 13 '10, 10:06 a.m.
JAZZ DEVELOPER
One other thing to check: which JDK/JRE are you using to run JBE (i.e. what do you get if you run 'java -version' from the dir where you normally start JBE)?
Try running with the JDK included in the Eclipse client. For details, see:
https://jazz.net/wiki/bin/view/Main/BuildFAQ#WhichJDK

permanent link
mike brosnan (1011213) | answered Dec 13 '10, 10:13 a.m.
I set up the JBE to run as a service and I'm using the JDK included with RTC

C:\jazz\service>C:\jazz\client\eclipse\jdk\bin\java -version
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build pwi32dev-20091106a (SR11
))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Windows Server 2003 x86-32 j9vmwi322
3-20091104 (JIT enabled)
J9VM - 20091103_45935_lHdSMr
JIT - 20091016_1845_r8
GC - 20091026_AA)
JCL - 20091106

C:\jazz\service>

permanent link
David Lafreniere (4.8k7) | answered Dec 13 '10, 11:24 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
I set up the JBE to run as a service and I'm using the JDK included with RTC


I'm going to test with JBE as a service as well (and try to do exactly what you did). In the meantime, can you try running JBE normally (not in a service) and try again?

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.