执行新建工程命令后报错:
powershell
mvn archetype:generate \
-DarchetypeGroupId=org.apache.flink \
-DarchetypeArtifactId=flink-quickstart-java \
-DarchetypeVersion=1.19.0
bash
org.apache.maven.lifecycle.MissingProjectException:
The goal you specified requires a project to execute but there is no POM in this directory.
Please verify you invoked Maven from the correct directory.
可能由以下三个原因引起:
- 命令不能换行,需要放在一行;
- cmd命令行或PowerShell,需要用引号包装参数(某些机器不需要)
- 命令中存在不必要的空格,比如等号两边存在空格
根据以上修改后的命令运行正常:
powershell
mvn archetype:generate "-DarchetypeGroupId=org.apache.flink" "-DarchetypeArtifactId=flink-quickstart-java" "-DarchetypeVersion=1.19.0"