我正在针对 CrEme VM 库构建一个项目。我想配置 maven 和 eclipse,只针对这个 JAR 构建。但是 m2eclipse “更新项目配置”会自动添加“JRE 系统库”。我可以通过在 eclipse 项目类路径中删除它来修复它,但我只想在 pom 中配置它.xml(而不是签入 eclipse 设置)。
我试图这样做:
// ...
<dependency>
<groupId>ch.sbb.cis-infra.mobile</groupId>
<artifactId>vmclasses</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
// ...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.3</source>
<target>1.3</target>
<meminitial>128m</meminitial>
<maxmem>512m</maxmem>
<debug>off</debug>
<compilerArguments>
<bootclasspath>''</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
</plugins>
</build>
但是,m2eclipse仍然添加了“JRE System Library [JRE_1.3]”。
命令行上的编译是正确的,但在 eclipse 中我看不到编译问题。如何使用 pom.xml 配置删除日食中的 JRE?
(Eclipse Helios SR2,m2e 插件 0.12.1)
好吧,恕我直言(我不确定)Eclipse中的JRE容器是因为项目的Java性质,而不是Maven集成。尝试禁用项目的Maven性质,JRE将仍然存在。如果你有Maven管理的Java项目(并且你的POM说),Eclipse中的Java性质被启用,导致JRE附加到项目。