【发布时间】:2015-11-10 14:01:10
【问题描述】:
你好,我想为 jenkins 写一个插件,需要 maven。 所以我安装了 maven 并在 cmd(windows 7) 中使用这个命令检查了安装:
mvn --version
输出就是这个
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06;
Maven home: C:\Program Files\maven
Java version: 1.8.0_60, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_60\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "dos"
所以 maven 是正确安装的。 但是当我尝试使用此命令创建项目时:
mvn archetype:create -DgroupId=com.itcuties -DartifactId=test
我得到这个建筑失败
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 0.084 s
[INFO] Finished at: 2015-11-10T14:20:49+01:00
[INFO] Final Memory: 4M/15M
[INFO]
------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (C:\Users\meyers). Please verify you invoked Maven from the correct directory. -> [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,
read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN
/MissingProject
Exception
我阅读了文档,但没有帮助。 我从本教程配置了 maven
https://www.youtube.com/watch?v=FWstBgxcoXw
【问题讨论】:
-
进入生成pom.xml的目录...重试
mvn package... -
我没有 pom.xml 数据。我如何创建它,当我写 mvn -cpu hpi:create 时也会出现构建失败
-
如果你想调用 Maven 需要一个 pom 文件...为什么你想调用
mvn hpi:create如果你需要在 pom.xml 文件所在的文件夹中.. .