类路径构建顺序更改
我在 OS X Snow Leopard 上使用 Eclipse 3.5 Java EE 64 位。
想知道每次运行标准 Ant 构建脚本时 .classpath 文件的标记顺序如何更改。
当我像这样手动更改构建路径顺序时(通过 Eclipse):
右键单击 Project Explorer 中的项目。
打开上下文菜单
转到构建路径
配置构建路径
单击Java 构建路径顺序和导出选项卡
将顺序修改为如下所示:
- myproject/work/src(将其移至顶部)
- 我的项目/工作/测试/单元
- myproject/work/impl/src
(myproject/work/impl/src 是链接的资源指向一个 在 Eclipse 中打开的第二个 Eclipse 项目 同时)
myproject/work/impl/src 默认位于订单的第一个位置。 手动将 myproject/work/src 移动到顶部(通过单击“向上”按钮)。
当我运行构建脚本时,.classpath 文件(此命令在幕后写入)似乎被重置为之前的状态:
这是为什么呢? Eclipse 在何时何地修改 .classpath 文件?如何设置才能让人们可以通过 Eclipse 手动更改构建顺序,但 .classpath 的构建顺序永远不会重置为其默认值?设置此选项并通过右键单击我的项目(不是 impl 项目)并转到“构建项目”来构建项目后,顺序永远不会改变。它仅在 Ant 构建脚本运行时重置。
I am using Eclipse 3.5 Java EE 64 bit on OS X Snow Leopard.
Was wondering how the .classpath file's tag's order gets changed everytime I run a standard Ant build script.
When I manually change the build path order like this (via Eclipse):
Right click on project in Project Explorer.
A context menu opens up
Go to Build Path
Configure Build Path
Click on the Java Build Path Order and Export Tab
Modified the order to look like this:
- myproject/work/src (moved this to the top)
- myproject/work/test/unit
- myproject/work/impl/src
(The myproject/work/impl/src is a linked resource which points to a
2nd Eclipse project which is open in Eclipse
at the same time)
The myproject/work/impl/src by default is at the first position for the order.
Manually moved myproject/work/src to the top (by clicking on the Up button).
When I run my build script, it seems that the .classpath file (which this order is written to behind-the-scenes) is reset to how it was before:
Why is this? Where and when does Eclipse modify the .classpath file? How can it be set so people can change the build order manually through Eclipse but the .classpath's build order never gets reset to its defaults? After setting this and building the project by right mouse clicking on my project (not the impl one) and going to Build Project, the order never gets changed. It only resets when the Ant build script is run.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每当类路径更改时。
您的问题可能因多种原因而发生。首先想到的一些问题包括:
似乎#3 最有可能。
Whenever the classpath is changed.
Your problem could be occurring for any number of reasons. Some of the ones that come to mind first include:
It seems #3 is most likely.