使用Maven建立父子項目

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章