maven的初步使用--Eclipse android maven的項目創建

別人說maven不錯,得去學學,故想放在android上使用,按照其他教程做了一遍。

發現在Eclipse建立maven後,等到Eclipse下載完成了,卻發現項目一堆錯誤,pom.xml出錯,整個項目打叉。

1. 項目中會缺少test路徑,新建一個src/test/java或者直接在build中去掉。

2. Plugin execution not covered by lifecycle configuration:

 com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:consume-aar (execution:
 default-consume-aar, phase: compile)
pom.xml報這個錯後,在網上找了好久都沒有找到合適的解釋,我猜是android-maven-plugin的版本不對或者太新,看到其他博文有用3.5.0版本的。我就在pom.xml裏改成3.5.0,發現還是不行,紅叉。最後重新新建工程,在 new maven project 裏將默認的android-plugin-version的3.8.2改爲3.5.0,確定,紅叉消失,程序順利編譯運行。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章