2011-11-03 75 views
0

我使用Eclipse 3.6(Helios64)和m2eclipse 0.12.1.20110112-1712。我有一個只包含兩個構建jar的類的新項目。當我右鍵單擊該項目並選擇「運行方式 - > Maven的包」,我得到以下錯誤:m2eclipse - 包上的神祕構建失敗

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ switch-provisioning-rest-client --- [INFO] Compiling 2 source files to C:\Devel\EclipseProjects\MyProject\target\classes 
[INFO] ------------------------------------------------------------- 
[ERROR] COMPILATION ERROR : 
[INFO] ------------------------------------------------------------- 
[ERROR] Failure executing javac, but could not parse the error: 
javac: invalid flag: -s 
... 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 

當我建立一個運行配置與目標「包-X」,該項目沒有建立錯誤。如果我運行的目標設置爲編譯的配置,它的構建沒有錯誤,然後我可以成功運行「Maven包」。

這是我遇到問題的唯一項目。我做的所有其他項目都在構建「Maven包」時成功完成。

項目pom.xml沒有什麼特殊之處。它指向與其他項目相同的父項目,幷包含項目特定的依賴關係。

有沒有人有任何想法這個項目可能會有什麼不同?

TIA!

回答

1

這個問題已經回答m2eclipse的郵件列表:

http://dev.eclipse.org/mhonarc/lists/m2e-users/msg01818.html

雖然我的POM有1.6的版本,該項目的配置還沒有更新。

From: Benjamin Bentmann

This issue is not really specific to m2e but applies to mvn in general, as such the Maven user list might provide a better audience for help.

IIRC, the specific error means you trying to use a JDK 1.5 while you need JDK 1.6+ where the javac option in question was added. Assuming your project should actually compile against JDK 1.5, downgrading the maven-compiler-plugin version might also do, I would expect it started to use the -s option when the annotation processing support was added.