私はMavenを初めて使用し、でプロジェクトを実行しようとしていますexec:java
。おそらくexecプラグインがないため、ビルドが失敗します。プラグイン(http://mvnrepository.com/artifact/org.codehaus.mojo/exec-maven-plugin)をダウンロードしましたが、Eclipseで使用できるようにするためにプラグインをどうすればよいかわかりません。 。ビルドパスに追加してみましたが、うまくいかなかったようです。これは非常に愚かな質問かもしれませんが、プラグインを機能させるにはどうすればよいですか?
これが私のビルド出力です:
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Twitter2 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ Twitter2 ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.826 s
[INFO] Finished at: 2015-06-11T14:24:29-06:00
[INFO] Final Memory: 10M/114M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project Twitter2: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java are missing or invalid -> [Help 1]
[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/PluginParameterException
エラーが示すように、mainClass
実行するクラスをプラグインに指示するパラメーターが正しく設定されていないようです。プラグインの目標の使用法については、http://www.mojohaus.org/exec-maven-plugin/java-mojo.htmlを参照してくださいjava
。POM構成にパラメーターを追加してみてください。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<configuration>
<mainClass>fully.qualified.class.name</mainClass>
</configuration>
</plugin>
または-Dexec.mainClass=fullClassName
、コマンドラインのプロパティを介して。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加