使用 archetype:generate
以与 Maven in 5 Minutes 中所述相同的方式创建项目。
得到这个错误:
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/mnt/c/Users/etomort/quartz-poc). Please verify you invoked Maven from the correct directory. -> [Help 1]
org.apache.maven.lifecycle.MissingProjectException: The goal you specified requires a project to execute but there is no POM in this directory (/mnt/c/Users/etomort/quartz-poc). Please verify you invoked Maven from the correct directory.
既然是这么基本的东西,我就糊涂了……
我查了这两个问题:
但是接受的答案都没有解决这个问题。
所以,我正在创建这个问题,以防有人一开始就没有得到它。
顺便说一下,输入的Maven命令是:
mvn archetype:generate -DgroupId=com.mycompany -DartifactId=quartz-poc -DarchetypeArtifactId= maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
最佳答案
如果您使用 Windows 并使用 cmd
命令行或 PowerShell
,则需要将参数用引号括起来:
mvn archetype:generate "-DgroupId=com.mycompany" "-DartifactId=quartz-poc" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DarchetypeVersion=1.4" "-DinteractiveMode=false"
在某些机器上,它虽然没有 cmd
上的引号。
关于bash - mvn 命令返回 : [ERROR] The goal you specified requires a project to execute but there is no POM in this directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60234708/