gpt4 book ai didi

在没有生命周期阶段或目标的情况下调用 mvn 时 Maven 构建失败

转载 作者:行者123 更新时间:2023-12-02 09:05:34 24 4
gpt4 key购买 nike

我尝试在 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

最佳答案

Maven 是一个构建工具,但与 ant 不同,它没有“默认”目标。所以当你运行时

 mvn

您没有提供足够的参数,您需要运行类似的内容

 mvn test

第二个参数指示 build lifecycle 沿线的位置你想停下来。然后,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)

关于在没有生命周期阶段或目标的情况下调用 mvn 时 Maven 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13606794/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com