运行mvn:generate生成新项目时出错

时间:2019-04-05 01:42:22

标签: java maven maven-archetype

给出原型cmd-

mvn archetype:generate -DarchetypeGroupId=io.confluent.maven.archetypes -DarchetypeArtifactId=kafka-connect-quickstart \
    -DarchetypeVersion=0.10.0.0

当我在一个新的空目录中运行此文件时,它应该为我创建一个源代码文件夹结构。

相反,我得到以下内容-

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.113 s
[INFO] Finished at: 2019-04-05T14:37:19+13:00
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (D:\Dev\sandpit\connect-quickstart). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

在我看来,它正在寻找一个pom文件,而我没有,因为这是一个新项目。

有任何线索吗?有什么帮助吗?

环境:Windows。 java -v == OpenJDK版本“ 11.0.2”

2 个答案:

答案 0 :(得分:1)

命令

Dockerfile

可以在我的计算机上正常运行。但是,如果我包含反斜杠(出现在您的问题中),则会出现与您显示的错误类似的错误。

答案 1 :(得分:1)

 mvn archetype:generate -DarchetypeGroupId=io.confluent.maven -DarchetypeArtifactId=kafka-connect-quickstart -DarchetypeVersion=0.10.0.0

您需要从io.confluent.maven.archetypes中删除原型,因为没有任何类似的groupId。在我的计算机上工作

您可以在这里参考
https://mvnrepository.com/artifact/io.confluent.maven/kafka-connect-quickstart/0.10.0.0