nep*_*tom 6 bash maven maven-archetype
按照5 分钟 Mavenarchetype:generate
中描述的相同方式创建项目。\n出现此错误:
[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]\norg.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.\n
Run Code Online (Sandbox Code Playgroud)\n\n因为这是这么基本的事情,所以我很困惑......
\n\n我检查了这两个问题:
\n\n\n\n但接受的答案都没有解决问题。
\n所以,我创建这个问题是为了防止有人碰到它但一开始没有明白。
顺便说一句,输入的Maven命令是:
\n\nmvn archetype:generate -DgroupId=com.mycompany -DartifactId=quartz-poc -DarchetypeArtifactId= maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false \n
Run Code Online (Sandbox Code Playgroud)\n
Nas*_*hil 13
如果您在Windows上并使用cmd
命令行 或PowerShell
,则需要将参数括在引号中:
mvn archetype:generate "-DgroupId=com.mycompany" "-DartifactId=quartz-poc" "-DarchetypeArtifactId=maven-archetype-quickstart" "-DarchetypeVersion=1.4" "-DinteractiveMode=false"
Run Code Online (Sandbox Code Playgroud)
在某些机器上,它可以在没有引号的情况下工作cmd
。
注意命令中的空格mvn
!
在我的问题中,额外的空间位于archetypeArtifactId
.
不管它在哪里,Maven 都会抱怨同样的消息。
我无意中引入了具有bash
自动完成功能的空格: