Maven错误执行archetype:generate时,此项目中没有POM

时间:2012-09-26 02:08:59

标签: java maven akka

我正在尝试Akka Pi java教程

我正在尝试按照教程

中的说明创建一个maven项目

但是每当我输入命令来创建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

看起来像maven正在请求POM文件,但是我没有在tutrial中声明我必须在生成项目之前创建POM。 我实际上是新朋友,所以请原谅我。 我正在使用maven版本:3.0.4 和akka版本2.0.2 但该教程使用的是akka 2.0.1版,但我不认为这是问题所在 任何建议请。

谢谢

2 个答案:

答案 0 :(得分:6)

删除\然后它应该开始查询更多信息。

我这里没有窗户,但在linux上它显示与

相同的行为
mvn archetype:generate /

HTH R

答案 1 :(得分:4)

当某些教程描述了要执行的mvn命令,该命令包含在两行或更多行中时,它们可能会在新行(指令)处添加一个额外的反斜杠,以指示相同的命令在下一行继续。

在执行命令之前,应删除此反斜杠。例如,设置Jersey Web应用程序的命令可能如下所示:

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \
-DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2

但应按如下方式启动,不得使用反斜杠:

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2

如果不删除这个额外的反斜杠,您可能会收到上述错误。