【问题标题】:Maven build failure when i create a maven project当我创建一个 Maven 项目时,Maven 构建失败
【发布时间】: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 文件所在的文件夹中.. .

标签: maven jenkins build


【解决方案1】:
  1. 这个命令:mvn archetype:create -DgroupId=com.itcuties -DartifactId=test需要pom.xml
  2. 要为jenkins编写插件,请参见官方文档https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-Eclipse

【讨论】:

    猜你喜欢
    • 2015-05-10
    • 2010-11-26
    • 1970-01-01
    • 1970-01-01
    • 2020-10-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-19
    相关资源
    最近更新 更多