2013-06-21 128 views
0

這是爲了在Ant中構建Eclipse時運行文件。我設置了我的Ant,現在我需要安裝Maven Ant任務。我遵循Maven網站上的說明:下載JAR並將其放入我的.ant/lib中,然後再次檢查我的環境變量是否正確。當我嘗試爲在Eclipse的Ant編譯運行,但是,它給了我這個錯誤:Apache Ant - 安裝Maven Ant任務

No types or tasks have been defined in this namespace yet 

This appears to be an antlib declaration. 
Action: Check that the implementing library exists in one of: 
    -C:\Users\arempel\Documents\eclipse\eclipse\plugins\org.apache.ant_1.8.3.v201301120609\lib 
    -C:\Users\arempel\.ant\lib 
    -a directory added on the command line with the -lib argument 

現在我知道有一噸的已經回答了這樣的解決問題,但我已經嘗試了所有我能找到的解決方案無濟於事。我已經嘗試在提示符中使用-lib,嘗試設置classpath變量,嘗試使用我的環境變量,但我仍然以某種方式搞砸了。

有誰知道我在做什麼錯,我錯過了什麼?

回答

1

在Eclipse中運行Ant時,它是Eclipse本身,它負責管理Ant的類路徑。

查看Eclipse的全局首選項,然後進入Ant/Runtime面板。第一個選項卡'Classpath'是您想要修改的選項卡。點擊'Global Entries',然後點擊'Add JARs ...'按鈕。選擇Maven Ant任務的jar,你就完成了。

+0

嗨,我只是試過這個,並從Eclipse運行構建,但它不適合我。我也嘗試從命令行傳入-lib lib參數。 –

+0

將maven-ant-tasks-2.1.3.jar添加到類路徑及其工作.. – Lucky