0
Eclipseのm2e
プラグインをインストールして、単純なアーキタイプを作成しました。私は小さなテストドライバを書いて、プロジェクトを(Maven経由で)ビルドし、Javaソースをクラスファイルにコンパイルしようとしています。M2Eclipse(M2E)ビルドエラー
私は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
私のpom.xmlで<build>
タグは次のとおりです:
<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>
いくつかのこと:
- 私
artifactId
、groupId
とversion
場合はどうあるべきかをここでは私のコンソール出力でありますこれは(標準)Mavencompile
フェーズですか? - これはMavenビルドを起動する正しい方法ですか(
Run Configurations
)? Antには、build.xml
で定義されているすべてのターゲットを表示できるプラグインがあります。私はMaven/m2eでそのようなアナログは見ません。 - なぜというコンパイルのプラグインが必要なのでしょうか?これはビルドツールの標準的な部分と考えられます。
ありがとう! pom.xmlを再検査した後、上に貼り付けた ''要素の赤色で強調表示されたエラー(Eclipseによる)が表示されます。エラーは次のようになります:*ライフサイクル設定でカバーされていないプラグインの実行:org.apache.maven.plugins:maven-compiler-plugin:2.3.2:コンパイラ:コンパイル(実行:デフォルト、フェーズ:コンパイル)あなたが話していることとは何ですか?もしそうなら、救済は何ですか? –
IAmYourFaja
また、私がビルドを開始する方法に関して、これはEclipse内部から(実行コンフィギュレーションを通じて)Maven/m2eを呼び出す標準的な方法ですか? – IAmYourFaja
何をしたいですか? Mavenは、ソースコードのビルドとパッケージ化に役立ちます。コンパイルはそのようなプロセスのほんの一歩です。さらに、このステップは、EclipseのEclipse Javaコンパイラによって実行されます。 Mavenユーザーのメーリングリストに詳細な質問を送ってください。 –