使用Eclipse创建Maven多模块项目

Nuñ*_*ada 4 eclipse maven

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

mvn archetype:create -DgroupId=com.websystique.multimodule -DartifactId=parent-project
Run Code Online (Sandbox Code Playgroud)

但我得到了这个错误:

[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
Run Code Online (Sandbox Code Playgroud)

avo*_*jak 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]
Run Code Online (Sandbox Code Playgroud)

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

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

你正在寻找的目标是generate.例如:

mvn archetype:generate -DgroupId=com.websystique.multimodule -DartifactId=parent-project
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息:maven-archetype-plugin.