> mvn ${groupId}:${artifactId}:${version}:${goal} -D${key1}=${val1} -D${key2}=${val2}
> mvn ${plugin-name}:${goal} -D${key1}=${val1} -D${key2}=${val2}
<POM> := modelVersion ; POM自身のバージョン
groupId ; 制作者の一意名
artifactId ; アーティファクトのファイル名
packaging ; アーティファクトの格納方式(jar,war,ear)
version ; アーディファクトのバージョン
name
url
<dependencies> ; このアプリケーションの依存ライブラリ群
<dependencies> := <dependency>*
<dependency>
:= groupId ; ${repository}/${groupId}/${artifactId}/${version}
artifactId ; より依存ライブラリを取得(※)
version ; repository := ~/.m2/repository
; | http://repo1.maven.org/maven2/
<scope> ; 必要になるフェーズ
コンパイル時 テスト時 実行時(アーティファクトに同梱)
<scope> := "compile" ; 取得 取得 取得
| "provided" ; 取得 取得 −−
| "runtime" ; −− 取得 取得
| "test" ; −− 取得 −−
| "system" ; 取得 取得 −−
| 1. | validate |
| 2. | initialize |
| 3. | generate-sources |
| 4. | process-sources |
| 5. | generate-resources |
| 6. | process-resources |
| 7. | compile |
| 8. | process-classes |
| 9. | generate-test-sources |
| 10. | process-test-sources |
| 11. | generate-test-resources |
| 12. | process-test-resources |
| 13. | test-compile |
| 14. | process-test-classes |
| 15. | test |
| 16. | prepare-package |
| 17. | package |
| 18. | pre-integration-test |
| 19. | integration-test |
| 20. | post-integration-test |
| 21. | verify |
| 22. | install |
| 23. | deploy |
life-cycle (mvn test)
validate
goal1 = xxplugin#doSomething()
goal2 = yyplugin#...()
initialize
goal3 = zzplugin#...()
generate-sources
...
test-compile
goal9 = aaplugin#...()
goal10 = bbplugin#...()
process-test-classes
goal11 = ccplugin#...()
goal12 = ddplugin#...()
test
goal13 = eeplugin#...()
が実行される/.m2/setting.xml
<settings>
<!-- ********** PROXY SERVER ********** -->
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>grape.hondou.homedns.org</host>
<port>3128</port>
<nonProxyHosts>localhost|*.foo.com</nonProxyHosts>
</proxy>
</proxies>
<!-- ********** EXHIBIT SERVER ********** -->
<servers>
<server>
<id>myScpServer</id>
<username>maven</username>
<password></password>
</server>
<server>
<id>myFtpServer</id>
<username>maven</username>
<privateKey></privateKey>
<passphrase></passphrase>
<filePermission>664</filePermission>
<direcotryPermission>775</directoryPermission>
<configuration>
<sshExecutable>plink</sshExecutable>
<scpExecutable>pscp</scpExecutable>
</configuration>
</server>
</servers>
</settings>
TODO: scp/PuTTy による接続実験