Maven Error No POM in this Project when performing archetype:generate

浪子不回头ぞ 提交于 2020-01-02 03:12:09

问题


I am trying my hands on the Akka Pi java tutorials

I am trying to creaate a maven project as stated in the tutorial

but any time I enter the command to create a maven project I get an error. Below are the command and the Error.

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.

thank you


回答1:


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

mvn archetype:generate /

HTH R




回答2:


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.

This backslash should be removed BEFORE executing the command. For instance the command for setting up a Jersey Web Application might look like this:

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.



来源:https://stackoverflow.com/questions/12593628/maven-error-no-pom-in-this-project-when-performing-archetypegenerate

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!