当我尝试设置新的快速入门项目时,Mvn命令失败

时间:2015-07-26 18:08:58

标签: maven

我正在尝试使用以下命令使用Maven下载现有的quickstart项目,但它会引发错误。

mvn -DarchetypeVersion=5.2.5 -Darchetype.interactive=false -DarchetypeArtifactId=quickstart -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.tapestry -DgroupId=de.laliluna \ -Dpackage=de.laliluna.helloworld -DartifactId=helloworld --batch-mode \ -DarchetypeRepository=http://tapestry.apache.org archetype:generate
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.114 s
[INFO] Finished at: 2015-07-26T23:30:40+05:30
[INFO] Final Memory: 4M/77M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (C:\Windows\System32). 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 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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject Exception
C:\Windows\System32>

有人在这帮助我吗? :) 编辑: 我刚注意到命令是三行命令。我是maven的新手,现在正在学习hibernate。有关如何执行以下命令的任何帮助?

mvn -DarchetypeVersion=5.2.5 -Darchetype.interactive=false -DarchetypeArtifactId=quickstart -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.tapestry -DgroupId=de.laliluna \
-Dpackage=de.laliluna.helloworld -DartifactId=helloworld --batch-mode \
-DarchetypeRepository=http://tapestry.apache.org archetype:generate

2 个答案:

答案 0 :(得分:0)

错误在你的代码片段中是没有pom.xml文件存在于你尝试mvn命令的地方去存在pom.xml的文件夹然后执行你想要做的动作

例如

cd c:\ workspace \ project 你的pom.xml就可以应用命令了

mvn clean,install,package

答案 1 :(得分:0)

你可能在Windows上。 The character to split commands across multiple lines on Windows^,而非\。可能更容易将整个命令放在一行上:

mvn -DarchetypeVersion=5.2.5 -Darchetype.interactive=false -DarchetypeArtifactId=quickstart -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.apache.tapestry -DgroupId=de.laliluna -Dpackage=de.laliluna.helloworld -DartifactId=helloworld --batch-mode -DarchetypeRepository=http://tapestry.apache.org archetype:generate