ant build.xml windows white space in path

心不动则不痛 提交于 2019-12-04 23:31:00

Change it to

appserver.home="C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0"

Variant with "/" instead "\" works on my system. Just need to delete " symbols before and after path structure.

It looks like you have your properties setup incorrectly.

I'm guessing your basedir property is pointing at C:\dev\Projects\springapp and your properties are using value like:

<property name="property.1" value="directory" />

instead of

<property name="property.1" location="directory" />

Using the location property then resolves links as relative to your basedir if the location is a relative path and to the absolute path if you enter one of those. If you could post parts of your Ant file specifically how you define appserver.home and how you use it in the task that's throwing the error I could be more specific.

gliptak

Find the Windows short name for those directories using dir /x and use thme when setting path values.

Some more discussion at How does Windows determine/handle the DOS short name of any given file?

In addition to escaping the windows directory separator also make sure that all paths that you type in should be with correct capitalisation, Windows is not case sensitive but case presrving, while Ant is case sensitive.

In the top of your build.xml, try adding <property environment="env"/> and then using ${env.USER_HOME} (or whatever you have in your environment). That did it for me (${env.JAVA_HOME} rather than ${java.home}).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!