今更なのですが、メモを残しておこうかと。というか http://code.google.com/p/maven-android-plugin/wiki/GettingStarted と http://rgladwell.github.com/m2e-android/ 見ればいいだけなんですが、まあ一応。
ちなみにADTからproject作っちゃった場合向けです。
- ADTでproject作る
- https://github.com/jayway/maven-android-plugin-samples/tree/stable/helloflashlight からpom.xmlをコピる
- pom.xmlを適当に修正
derectiveのcom.google.androidのversionについては、1.5_r4, 1.6_r2, 2.1.2, 2.2.1のいずれか。 - maven-android-pluginのsdkについても適切に修正(8とか)
- mvn install
- mvn android:deploy
ここまでで、command lineからapkをbuildできるようになっているんですが、Eclipseと連携させたい場合は以下も。
- m2eclipse pluginをinstall (適当に検索してくらさい)
- Configuration -> Convert to Maven Project
- それっぽく進みますが "Plugin execution not covered by lifecycle configuration" error が出るのでpom.xml開いてquick fix
- m2e connectorをinstallしてrestart
細かいところは忘れたけど、大体上記の手順でいけた気がします。
- 補足 (2012-05-06 GW最終日)
https://github.com/jayway/maven-android-plugin-samples/tree/stable/helloflashlight は何だかバグりまくってる風なので使わない方が良いです。
http://code.google.com/p/maven-android-plugin/wiki/QuickStartForEclipseProject とかの方が良いというか、やはり https://github.com/akquinet/android-archetypes をArchTypeに追加しつつこれを使った方がハマりにくいかと。