Maven3を実行した際のWarningについて
Doltengで自動生成したpom.xmlをMaven3で実行したとき
以下の様なWarningが発生した。
[WARNING] [WARNING] Some problems were encountered while building the effective model for パッケージ名:プロジェクト名:war:0.0.1 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 27, column 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 35, column 12 [WARNING] 'repositories.repository.id' must not be 'local', this identifier is reserved for the local repository, using it for other repositories will corrupt your repository metadata. @ line 87, column 8 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING]
1つ1つ見ていくことにする。
[WARNING] 'repositories.repository.id' must not be 'local', this identifier is reserved for the local repository, using it for other repositories will corrupt your repository metadata. @ line 87, column 8
localというのがないようなので該当の行の「local」を「localrepository」に変更。
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 27, column 12 [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 35, column 12
versionの省略は不可になったようだ。
Warningとなっている、プラグインに
<version>プラグインのバージョン</version>
を追記する。
最新バージョンは、以下のサイトで検索が可能。
http://search.maven.org/
そして、いつも通りMavenを実行する。
mvn clean install -Dmaven.test.skip=true mvn eclipse:eclipse
を実行する。
・・・Warningが出なくなり、スッキリ。
ちなみにDoltengを使用した自動生成はMaven2で動かす前提っぽい。
以上