使用Eclipse创建Maven多模块项目

时间:2017-05-02 18:00:04

标签: eclipse maven

我想创建一个maven多模块项目。 我想使用

创建父项目
mvn archetype:create -DgroupId=com.websystique.multimodule -DartifactId=parent-project

但我收到了这个错误:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.203 s
[INFO] Finished at: 2017-05-02T19:57:19+02:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.1 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [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/MojoNotFoundException

1 个答案:

答案 0 :(得分:8)

您是否阅读了错误消息?

[ERROR] Could not find goal 'create' in plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.1 among available goals crawl, create-from-project, generate, help, integration-test, jar, update-local-catalog -> [Help 1]

错误消息告诉您,您为插件指定的目标(create)不是可用选项之一。它还列出了有效的选项:

  • crawl
  • create-from-project
  • generate
  • help
  • integration-test
  • jar
  • update-local-catalog

您正在寻找的目标是generate。例如:

mvn archetype:generate -DgroupId=com.websystique.multimodule -DartifactId=parent-project

更多信息:maven-archetype-plugin