m2e
Eclipse 用のプラグインをインストールし、それを使用して単純なアーキタイプを作成しました。小さなテスト ドライバーを作成し、(Maven を使用して) プロジェクトをビルドし、Java ソースをクラス ファイルにコンパイルしようとしています。
に行ってRun >> Run Configurations
作成しNew Maven Build
ます。名前を付けて、ベース ディレクトリをプロジェクト ルートに設定します。
選択しようとするGoals
と、何も表示されないため、追加/指定できません。ボタンをクリックしRun
ます。これが私のコンソール出力です:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.me:myproject:0.0.1-SNAPSHOT (C:\Users\me\workbench\eclipse\workspace\MyProject\pom.xml) has 3 errors
[ERROR] 'build.plugins.plugin.artifactId' is missing. @ line 145, column 17
[ERROR] 'build.plugins.plugin.groupId' is missing. @ line 144, column 14
[ERROR] 'build.plugins.plugin.version' for : must be a valid version but is ''. @ line 146, column 14
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
<build>
私の pom.xmlのタグは次のとおりです。
<build>
<plugins>
<plugin>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compiler:compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
いくつかのこと:
- これが (標準) Mavenフェーズである場合
artifactId
、私の はどうあるべきですか?groupId
version
compile
- これは Maven ビルドを起動する正しい方法
Run Configurations
ですか? Ant には、で定義されたすべてのターゲットを表示できるプラグインがありますbuild.xml
。Maven/m2e にはそのような類似物はありません。 - コンパイルのような単純なものにプラグインが必要なのはなぜですか? これは、あらゆるビルド ツールの標準的な部分であると考えられます。