我为我的应用程序库声明了以下类路径引用:
<path id="libraries">
<fileset dir="${lib.dir}" includes="**/*.jar" />
</path >
Run Code Online (Sandbox Code Playgroud)
我可以使用librairies的类路径编译代码:
<javac srcdir="${src}" destdir="${build.classes}" classpathref="libraries"/>
Run Code Online (Sandbox Code Playgroud)
但我找不到在我的WAR文件中包含librairies文件集的方法:
<war destfile="${release.dir}/rel.war" webxml="${webinf}">
<classes dir="${build.classes}"/>
<!-- I need to copy paste the same directory declaration! -->
<lib dir="${lib.dir}" includes="**/*.jar"/>
</war>
Run Code Online (Sandbox Code Playgroud)
如何将"lib"声明替换为重用与javac任务相同的路径?
声明filesetoutpath并为其分配一个标识符:
<fileset id="xxx" dir="..." includes="..." />
Run Code Online (Sandbox Code Playgroud)
然后在两个声明中引用标识符(lib指定文件集,因此不必使用嵌套):
<path id="libraries">
<fileset refid="xxx"/>
</path>
...
<lib refid="xxx"/>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1699 次 |
| 最近记录: |