Use Maven to build parent-child projects

1. Use the mvn command to create two general java projects and one web project respectively

mvn archetype:create   -DgroupId=com.cx  -DartifactId=child1  -DarchetypeArtifactId=maven-archetype-quickstart 

mvn archetype:create   -DgroupId=com.cx  -DartifactId=child2  -DarchetypeArtifactId=maven-archetype-quickstart 

mvn archetype:create  -DgroupId=com.cx -DartifactId=myweb  -DarchetypeArtifactId=maven-archetype-webapp 

 

2. Create parent projects (parent), manage plugins (site, tomcat , etc. ), reports (javadoc, findbugs, checkstyle, etc.) and dependencies. The version of the dependent package can be specified according to the profile.

3. Modify the pom.xml file, rely on parent, and add the outermost pom.xml. You can use profiles to include modules or specify modules directly.

 

mvn eclipse:eclipse

mvn install -Dmaven.tets.skip=true

mvn clean

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326666493&siteId=291194637