As MAVEN management projects become more prevalent, the biggest benefit of MAVEN is the centralized management of the warehouse that relies on packages, and Maven can use inheritance and aggregation.
1.Maven multi-module project.
The MAVEN multi-module project requires a parent project to aggregate other modules, which is the Pom.xml file:
< Modules > < Module > Module 1</module><module> Module 2 </ Module > </ Modules >
Then in the Submodule, declare the parent project, and the code in the Submodule is as follows:
<Parent> <groupId>GroupID of the Parent project</groupId> <Artifactid>Artifactid of the Parent project</Artifactid> <version>Version number</version> <RelativePath>.. /..</RelativePath></Parent>
2.Maven merge multiple Web projects.
MAVEN's multi-module Maven-war-plugin plugin overlays property to handle the pom.xml of the project:
<Build> <Finalname>Project Publication name</Finalname> <Pulgins> <Pulgin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-war-plugin</Artifactid> <Configuration> <Packagingexcludes> <Overlays> <Overlay> <groupId>Web1</groupId> <Artifactid></Artifactid> </Overlay> <Overlay> <groupId>Web2</groupId> <Artifactid></Artifactid> </Overlay> <Overlay> <groupId>Web3</groupId> <Artifactid></Artifactid> </Overlay> </Overlays> </Packginexcludes> </Configuration> </Pulgin> </Pulgins> <Resources> <Resource> <Directory>Brutishness</Directory> <excludes> <Exclude>config/**</Exclude> </excludes> </Resource> <Resource> <Directory>Src/main/resources</Directory> </Resource> </Resources> </Build>
Attentive users will find that, in fact, this is completely the same as our original construction, deployment, yes, MAVEN is not so complicated, m2eclipse maven plugin has helped us do a lot of things, Maven will only make the migration between our projects more convenient, more concise, That's one of the big reasons I like maven.
I am an absolute maven novice, the above article with only Maven's fur just, Maven more build function also need to go into the research, the above article just want to tell those who want to try Maven novice, in fact, maven not only to the code management brought great convenience, And we can not change our original development habits completely. So, embrace maven!
Using MAVEN to merge Web projects