1.分別使用mvn命令建立倆個一般的java項目和1個web項目
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.建立父項目(parent),管理插件(site、tomcat等)、報告(javadoc、findbugs、checkstyle等)和依賴。可根據profile指定依賴包的版本。
3.修改pom.xml文件,依賴parent,並新增最外層的pom.xml,可使用profiles包含modules或直接指定modules.
mvn eclipse:eclipse
mvn install -Dmaven.tets.skip=true
mvn clean