看来 m2eclipse 无法识别我的 $M2_OPTS 变量。
我可以在 Eclipse 之外运行相同的构建(使用增加的 heapsize):
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 51 seconds
[INFO] Finished at: Tue Nov 10 00:00:02 EST 2009
[INFO] Final Memory: 72M/187M
[INFO] ------------------------------------------------------------------------
但是当我用 m2eclipse 运行它时,我总是内存不足:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Java heap space
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
...
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 27 seconds
[INFO] Finished at: Mon Nov 09 23:56:32 EST 2009
[INFO] Final Memory: 43M/81M
[INFO] ------------------------------------------------------------------------
有任何想法吗?
解决方案:将 mem args 添加到 Java 首选项的 Installed JREs 选项卡中。