我首先描述了我的尝试。我有一个在网络中创建的Web服务 豆子。它工作正常。我想在我的项目中使用GeoIP [link] [1] 所以[tutorial] [2]说我要用maven安装。所以我有 下载了[maven] [3]。然后我提取整个文件夹,然后跟着 添加环境变量的指令,我已经测试过了 正在运行"
mvn -version
"在cmd。在这里,每件事情似乎都很好。 然后我想我必须添加一个名为" pom"的xml文件。到了根 由于[文档] [4],我的项目目录(Web服务)。 现在它说我必须运行这个:"mvn build
"。我在cmd尝试过。但 它告诉我该目录不正确。我改变了cmd's 目录到" web服务的根文件夹"项目。和奔跑 mvn构建。但我仍然有错误。
错误消息:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building geo-maven 1.0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.116 s
[INFO] Finished at: 2014-08-13T12:48:00+04:30
[INFO] Final Memory: 5M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Unknown lifecycle phase "build". You must specify a valid lifecycle phas
e or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-ar
tifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate,
initialize, generate-sources, process-sources, generate-resources, process-resou
rces, compile, process-classes, generate-test-sources, process-test-sources, gen
erate-test-resources, process-test-resources, test-compile, process-test-classes
, test, prepare-package, package, pre-integration-test, integration-test, post-i
ntegration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site
, site, post-site, site-deploy. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/LifecyclePhase
NotFoundException
now my mind is blowing.
please help me!
[1]: http://dev.maxmind.com/geoip/geoip2/geolite2/
[2]: http://maxmind.github.io/GeoIP2-java/
[3]: http://maven.apache.org/download.cgi
[4]: http://spring.io/guides/gs/maven/
答案 0 :(得分:-1)
您已获得:未知生命周期阶段&#34;构建&#34; 。 这意味着您给出的命令 mvn build 几乎没有任何意义。
您可能已阅读过Maven文档,例如: introduction-to-the-lifecycle,您将了解maven阶段和目标,以发出正确的命令。
目前,请尝试最常见的 mvn clean install 。