Alex Rivera | Logout

mkdir in ant fails. How can i handle this error

Asked 2012-02-15T09:14:40.570
8

The ANT build script I have does the following:

  1. Perform the builds on Windows server & Zip the binaries
  2. Map a network drive with different credentials to a local drive (ex P:) using net use
  3. I am using <mkdir> to create a directory on the mounted drive (P:)
  4. Copy the binaries to that drive

Below is my code for mkdir

<echo>Creating ${buildRequesterUserId} folder at mirroring site starts</echo>
<mkdir dir="P:\build_output\${buildRequesterUserId}"/>
<echo>Creating ${buildRequesterUserId} folder at mirroring site ends</echo>

Some time the creation of folder works and some time it fails with below error

creation was not successful for an unknown reason and makes the build fail

This error happens randomly. The Mkdir works some time. I am not sure why it fails and not sure if its because of network lag

also the directory i am trying to create may or may not exist already. I read that the mkdir does not do anything if directory exists already

I checked and there is no failonerror for mkdir. I don't want the build to fail because of this.

I have handled the error in copy part but not sure how to handle this mkdir

How can I achieve this? Any help would be appreciated

Regards

Karthik

Edit
Report

1 Answer

-4

Here's how I solved it:

  1. Open your build.properties file (Actually open all properties files' referenced from build.xml)
  2. Check for any trailing spaces and tabs on any line of the file.
  3. Add an additional blank line to the end of file.
answered 2013-04-14T12:02:36.190

Your Answer