读书人

使用Maven建立爷儿俩项目

发布时间: 2014-01-09 23:07:34 作者: rapoo

使用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

读书人网 >软件开发

热点推荐