我有一个包含绝对路径到jars等的属性文件 . 使用这些属性时,它们以构建文件中指定的basedir为前缀 . How do I get the absolute path?
build.properties:
mylib=/lib/mylib.jar
build.xml文件:
<project name="myproject" basedir=".">
<property file="build.properties"/>
...${mylib}...
</project>
1 回答
请看一下房产任务:
http://ant.apache.org/manual/Tasks/property.html
通过使用位置属性,例如:
这会将任何相对属性扩展到其完整的绝对路径 . 当然,路径相对于项目的基础而扩展 .