7

Eclipse で Maven を使用してプロジェクトをビルドしようとしています。最初のビルドは素晴らしかった。その後、このエラーが発生します:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.129s
[INFO] Finished at: Wed Nov 28 17:51:35 GST 2012
[INFO] Final Memory: 2M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle
phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>
:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate,
initialize, generate-sources, process-sources, generate-resources, process-resources,
compile, process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile, process-test-classes, test,
prepare-package, package, pre-integration-test, integration-test, post-integration-test,
verify, install, deploy, pre-site, site, post-site, site-deploy, pre-clean, clean,
post-clean. -> [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/NoGoalSpecifiedException
4

3 に答える 3

21

Maven はビルド ツールですが、ant「デフォルト」の目標はありません。だからあなたが走るとき

 mvn

十分な引数を指定していません。次のようなものを実行する必要があります

 mvn test

2 番目の引数は、ビルド ライフサイクルのどこで停止するかを示します。Maven は、指定したステップまでのすべてのステップを実行します。

いくつかの一般的な停止ポイント

 mvn compile (just compile)
 mvn test (compile and run unit tests)
 mvn package (compile, run unit tests, and build the distributable package)
 mvn install (all of the above, and install distributable package into local repository.
     Install is very useful if you need to build other packages which depend on changes
     to this package)
 mvn deploy (all of the above, and install package into remote (aka public) repository
     for sharing with other developers)
于 2012-11-28T14:00:35.637 に答える
7

コマンドまたは eclipse を使用して目標を設定できます。

ここに画像の説明を入力

于 2015-10-22T20:49:08.523 に答える
3

コンパイルインストールなど、ビルドの目標を指定する必要があります。Eclipse の起動構成を確認してください。

于 2012-11-28T14:00:17.110 に答える