问题描述
我正在尝试构建一个目标,该目标包含很长的 <pathelement location="${xxx}"/>
和 <path refid=foo.class.path"/>
元素在其 元素(在 build.xml 文件中).我不断收到包 com.somecompany.somepackage 不存在"错误,而且我很难找到这些包并确保我已经从我们的存储库中同步了它们.
I'm trying to get a target to build that has quite a long list of <pathelement location="${xxx}"/>
and <path refid="foo.class.path"/>
elements in its <path id="bar.class.path">
element (in the build.xml file). I keep getting "package com.somecompany.somepackage does not exist" errors, and I'm having a hard time chasing down these packages and making sure I've synced them from our repository.
我是这个团队的新手,所以我不熟悉构建,但如果可能的话,我更愿意自己解决这个问题(所以我不会打扰其他非常忙碌的团队成员).我对 Ant 的经验非常有限.
I'm new to this team so I'm unfamiliar with the build, but I would prefer to figure this out myself if possible (so I don't bother the other very busy team members). I have very limited experience with Ant.
如果我可以让 Ant 打印出我正在尝试构建的目标的类路径,我认为这会为我节省相当多的时间.
I think it would save me quite a bit of time if I could have Ant print out the classpath for the target I'm trying to build.
推荐答案
使用 pathconvert
任务将路径转换为属性
Use the pathconvert
task to convert a path to a property
<path id="classpath">
....
</path>
<pathconvert property="classpathProp" refid="classpath"/>
<echo>Classpath is ${classpathProp}</echo>
这篇关于是否可以让 Ant 打印出特定目标的类路径?如果是这样,如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!