Eclipse M2E/更改订单和导出 [英] Eclipse M2E / change Order and Export
问题描述
我正在使用Eclipse(Indigo)中的Maven项目.
I'm working with maven projects in Eclipse (Indigo).
为了编译一些需要认可库的类(webservices-api.jar),我转到属性/Java构建路径/命令和导出",并将"Maven Dependecies"移到"JRE System Library"之前.
In order to compile some classes that need endorsed libraries (webservices-api.jar) I go to "Properties/Java Build Path/Order and Export" and move "Maven Dependecies" before "JRE System Library".
问题在于,每当我单击"Maven/更新项目配置"选项时,条目都会重新排列,并且"JRE系统库"始终是第一个条目,并且代码不再编译.
The problem is that whenever I click on the "Maven/Update Project configuration" option the entries are rearranged and "JRE System Library" is always the first entry, and the code no longer compiles.
有没有办法让M2E记住我的选择并停止重新排列库?
Is there a way to have M2E remember my choice and stop rearranging the libraries?
预先感谢
推荐答案
我最终实现的解决方案是让ant目标在.classpath文件中进行替换以交换类路径容器.我在我的项目中添加了一个蚂蚁生成器,以调用该目标,然后在Java编译器之前刷新该项目.有点复杂,但是却像是一种魅力.
The solution I ended up implementing is having an ant target do a replacement in the .classpath file to swap the classpath containers. I add an ant builder to my project that calls that target and then refresh the project before the java compiler. A little complex, but it works like a charm.
这篇关于Eclipse M2E/更改订单和导出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!