0

I have a build file, which has the following property in it.

   <property name="schema.dir" value="src/main/resources/schema" />

This schema.dir is used to refer a wsdl file.The parent folder which contains the build.xml has a space in it like this folder name . When I echoed the property it displayed only src/main/resources/schema. But I can see from the ant logs that issue is with the space in the folder name. Since the parent folder is having a space in it, I am not able to refer the wsdl.

Can somebody suggest a solution so that file can be accessed with out changing the folder name

dileepVikram
  • 890
  • 4
  • 14
  • 30

2 Answers2

0

Is it possible to provide directly full path to wsdl file?

Try to replace " " sign with "%20".

For test you can hardcode that and with ANT you can use the propertyregex task from Ant Contrib. See Replacing characters in Ant property

Community
  • 1
  • 1
Chris D
  • 122
  • 7
  • It is working at some places, like where we are refering the WSDL file, but it failed for certain cases where I tried to copy the files. I have used the '' command.It returned an error like _Could not find file /home/interface/projects/Workspace/Interface%20Server/UniServ/Webservices/src/main/resources/schema/IDAuthentication/IDAuthentication.wsdl to copy_ – dileepVikram Oct 20 '14 at 12:14
  • Please recheck your test with '' -> in stack trace that you provided "ma‌​in" string may contain different chars (try to search "ma‌​in" in this page and you will notice). It should be like "'${property with blanks}'" New idea: try to surround path with ' char -> see [ant java task with space issue](http://stackoverflow.com/questions/6747814/ant-java-task-with-space-issue) – Chris D Oct 20 '14 at 12:20
  • The issue was like I was able to refer a wsdl file from the build file using this path **/home/interface/projects/Workspace/Interface%20Server/UniServ/Webservices/src/main/resources/schema/BizIDVerification/BizIDVerification.wsdl**, which I modified using the propertyregex task. But the same path failed when I used for a copy task. So I have used the path with out applying the propertyregex ie like this **/home/interface/projects/Workspace/Interface Server/UniServ/Webservices/src/main/resources/schema/BizIDVerification/BizIDVerification.wsdl**, and it worked. – dileepVikram Oct 21 '14 at 08:08
0

Have you tried specifying your property as a location rather than a string so Ant knows it's dealing with a file path, you can also specify the path as relative to your base directory.

<property name="schema.dir" location="${basedir}/src/main/resources/schema"/>

Adding ${basedir} to the path may not be necessary after changing the property from a value to a location.

ptha
  • 836
  • 1
  • 8
  • 22