安装maven:
C:\Windows\System32>mvn --version
Apache Maven 3.3.3 (7994120775791599e405a7528ec3e0dke21dja06; 2015-04-22T13:57:3
7+02:00)
Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.3.3
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.7.0_51\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "windows"
字符串
我试图生成泽西glassfish项目的maven提示的帮助下,但当我键入以下内容:
D:\maven>mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archety
pes -DinteractiveMode=false \ -DarchetypeVersion=2.17
型
我得到这个错误:
您指定的目标需要一个项目来执行,但此目录(D:\maven)中没有POM。请验证您是否从正确的目录调用了Maven。-> [Help 1]
我不理解错误:这里需要哪个项目,因为我正在尝试生成一个项目?我应该如何创建pom.xml文件?我认为它是由项目生成创建的。
我很感激任何帮助。
不带\
输入时编辑
D:\maven>mvn archetype:generate -DarchetypeGroupId=org.glassfish.jersey.archety
pes -DinteractiveMode=false -DarchetypeVersion=2.17
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.3:generate (default-cli) > generate-sources
@ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.3:generate (default-cli) < generate-sources
@ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.3:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Batch mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.glassfish.jer
sey.archetypes:maven-archetype-quickstart:2.17)
Downloading: https://repo.maven.apache.org/maven2/org/glassfish/jersey/archetype
s/maven-archetype-quickstart/2.17/maven-archetype-quickstart-2.17.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.542 s
[INFO] Finished at: 2015-05-12T16:39:51+02:00
[INFO] Final Memory: 17M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2
.3:generate (default-cli) on project standalone-pom: The desired archetype does
not exist (org.glassfish.jersey.archetypes:maven-archetype-quickstart:2.17) -> [
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/MojoFailureExc
eption
D:\maven>
型
2条答案
按热度按时间hwamh0ep1#
我现在就去找答案
所以问题的第一部分是字符“"。参见this thread
那么对于你的第二个问题:上面写着
The desired archetype does not exist
。这个原型maven-archetype-quickstart在maven仓库中不存在。请参考this link来选择你要找的原型,并把它放在你的命令中。在命令的最后,必须至少有两个参数
-DarchetypeGroupId
和-DarchetypeArtifactId
。例如:字符串
hmmo2u0o2#
我可以解决maven *mvn archetype:generate * 问题“您指定的目标需要执行一个项目,但此目录中没有POM”在Windows上。
它与Windows PowerShell如何解释命令有关
您需要将 mvn archetype:generate 的参数用**双引号(“”)**括起来。
举例来说:
字符串
另外,请确保您正在EMPTY目录上运行此命令。