顯示具有 maven 標籤的文章。 顯示所有文章
顯示具有 maven 標籤的文章。 顯示所有文章

使用Maven時出現 Unable to find the mojo 'generate-sources' (or one of its required components) in the plugin 'com.jayway.maven.plugins.android.generation2:android-maven-plugin' 問題

最近在使用Maven來build Spring Android的Sample Project時,在mvn clean install的階段時,會出現Unable to find the mojo 'generate-sources' (or one of its required components) in the plugin 'com.jayway.maven.plugins.android.generation2:android-maven-plugin'這樣的問題。

第一個問題是,Spring Android的Sample Project需要使用Maven3.0.3以上,請參考issue220

接著,當你在使用maven 3去install時,如果出現java.lang.NoClassDefFoundError: org/codehaus/plexus/classworlds/launcher/Launcher的錯誤,請先檢查原本的作業系統中,是否有安裝maven2,如果有,要去環境變數中,把相關的path給拿掉,如果有設定M2_HOME,也要一併移除。

Maven 之 POM(Project Object Model) 設定檔

在Maven中,最重要也是最基本的就是POM(Project Object Model)了。POM是一個XML的設定檔,它包含了Maven在建置專案時的所有資訊。

在執行Maven時,它會去檢查專案目錄下是某具有pom.xml檔案,如果沒有時,任何操作都會出現build error。

Maven 介紹

Maven是一套用來管理Java專案的工具,使用Maven,你可以讓專案在建置、測試、管理、部屬等工作上更為輕鬆。同時在管理dependency上,更是會讓你用起來愛不釋手。

我們先透過一個小範例讓大家對Maven的運作有一個初步的了解,在使用它之前,你必須要先安裝好適當的jdk。
首先,請先下載Maven,在這一篇的操作中,我們已Maven 2.2.1版本為主。
下載頁面:http://maven.apache.org/download.html

Eclipse安裝Maven套件時出現 "Cannot complete the install because one or more required items could not be found." 的解決方法

最近在Eclipse安裝Maven套件時,會出現這樣的錯誤

Cannot complete the install because one or more required items could not be found. Software being installed: Maven Integration for Eclipse (Required) 0.12.1.20110112-1712 (org.maven.ide.eclipse.feature.feature.group 0.12.1.20110112-1712) Missing requirement: Maven Integration for Eclipse (Editors) 0.12.1.20110112-1712 (org.maven.ide.eclipse.editor 0.12.1.20110112-1712) requires 'bundle org.eclipse.zest.core 0.0.0' but it could not be found Cannot satisfy dependency: From: Maven Integration for Eclipse (Required) 0.12.1.20110112-1712 (org.maven.ide.eclipse.feature.feature.group 0.12.1.20110112-1712) To: org.maven.ide.eclipse.editor [0.12.1.20110112-1712]

看起來是缺少一些dependency的套件, 查了一下,只要安裝GEF套件即可,網址在此:http://download.eclipse.org/tools/gef/updates/releases/

另外,Maven的Update Site:http://m2eclipse.sonatype.org/sites/m2e