maven multimodule not keep the mapping module when import to new eclipse workspace
I created a maven multi-module project by using eclipse and m2eclipse plugin: First: i created a parent project by using eclipse (choose menu\New\Maven project), then right click on that project and click New\Other\MavenModule). I have 2 modules. by using that way, on the project Explorer panel, i can see one parent project and 2 module like this:
- parent
- module 1
- module 2
- module 1 (mapping from module 1 that stay inside parent)
- module 2 (mapping from module 2, whatever you change here will be reflect to module 2 that stay inside parent)
I like this way, because i can treat the modules like a real eclipse project, i can right click on the module and do Clean or Build.
But now the problem happened when i creat开发者_开发技巧e a new workspace and import the parent project into new workspace (i still using the same eclipse), the module mapping disappear. now in the new workspace, what i can see is:
-parent
- module 1
- module 2
The new look is so inconvenient. i dont have availability to treat the module like the real project any more.
My question is how to fix that issue? what i want is when import to a new workspace, the project still have the mapping modules go along with.
go to workspace parent folder try running this
mvn eclipse:eclipse
see here what it does: http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
eclipse:eclipse
Full name: org.apache.maven.plugins:maven-eclipse-plugin:2.8:eclipse
Description: Generates the following eclipse configuration files:
- .project and .classpath files
- .setting/org.eclipse.jdt.core.prefs with project specific compiler settings
- various configuration files for WTP (Web Tools Project), if the parameter wtpversion is set to a valid version (WTP configuration is not generated by default)
If this goal is run on a multiproject root, dependencies between modules will be configured as direct project dependencies in Eclipse (unless useProjectReferences is set to false).
精彩评论