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

fai*_*lai 7 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
Run Code Online (Sandbox Code Playgroud)

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

谢谢

rom*_*ius 7

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

我这里没有窗口,但在linux上它显示了相同的行为

mvn archetype:generate /
Run Code Online (Sandbox Code Playgroud)

HTH R


Dan*_*son 5

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

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

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes \
-DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
Run Code Online (Sandbox Code Playgroud)

但应按以下方式启动,且不加反斜杠:

mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archetypes -DarchetypeArtifactId=jersey-quickstart-webapp -DarchetypeVersion=2.2
Run Code Online (Sandbox Code Playgroud)

如果不删除此多余的反斜杠,则可能会收到上述错误。