java 执行原型时,Maven 错误在此项目中没有 POM:生成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12593628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Maven Error No POM in this Project when performing archetype:generate
提问by faisal abdulai
I am trying my hands on the Akka Pi java tutorials
我正在尝试 Akka Pi Java 教程
I am trying to creaate a maven project as stated in the tutorial
我正在尝试按照教程中的说明创建一个 Maven 项目
but any time I enter the command to create a maven project I get an error. Below are the command and the Error.
但是每当我输入命令来创建 Maven 项目时,都会出现错误。下面是命令和错误。
C:\Program Files\akka-2.0.2>mvn archetype:generate \
C:\Program Files\akka-2.0.2>mvn archetype:generate \
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.206s
[INFO] Finished at: Wed Sep 26 02:50:38 BST 2012
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
in this directory (C:\Program Files\akka-2.0.2). Please verify you invoked Mave
n 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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProject
Exception
looks like maven is requesting for the POM file but it is not stated in the tutrials that I have to create a POM before generating the project. I am actually new too maven so pardon me. I am using maven version :3.0.4 and akka version 2.0.2 but the tutorial uses akka version 2.0.1 but i donn't think that is the problem any suggestion please.
看起来 maven 正在请求 POM 文件,但在 tutrials 中没有说明我必须在生成项目之前创建 POM。我实际上也是新手,所以请原谅我。我正在使用 maven 版本:3.0.4 和 akka 版本 2.0.2,但本教程使用 akka 版本 2.0.1,但我认为这不是问题,请提出任何建议。
thank you
谢谢
采纳答案by romedius
remove the \
then it should start to query for more informations.
删除\
然后它应该开始查询更多信息。
I have no windows here, but on linux it shows the same behavior with
我这里没有窗口,但在 linux 上它显示了与
mvn archetype:generate /
HTH R
高温高压
回答by Daniel Nelson
When some tutorials describes a mvn command to be executed that is covered in two rows or more, they might add an extra backslash at the new line (of the instruction) to indicate that the same command continues on next line.
当一些教程描述要执行的 mvn 命令被覆盖在两行或更多行时,他们可能会在(指令的)新行添加一个额外的反斜杠,以指示相同的命令在下一行继续。
This backslash should be removed BEFORE executing the command. For instance the command for setting up a Jersey Web Application might look like this:
在执行命令之前,应删除此反斜杠。例如,用于设置 Jersey Web 应用程序的命令可能如下所示:
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \
-DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
but should be launched as below, without backslash:
但应该如下启动,没有反斜杠:
mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
If NOT removing this extra backslash you might get the error you described above.
如果不删除这个额外的反斜杠,您可能会收到上述错误。