maven3

app:

mvn archetype:generate -DgroupId=net.srirangan.packt.maven -DartifactId=MySampleApp

webapp:

mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp

 

-------------------------------------------

mvn validate

mvn compile

mvn package

mvn test

 

子项目/子模块

需要先建立父项目:<packaging>pom</packaging>

然后在父项目中再创建子项目/模块

 

mvn site:run 

------------------------------------------------

test report:

<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>

 

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<configuration>
<instrumentation>
<ignores>
<ignore>com.test.somepackage.*</ignore>
</ignores>
<excludes>
<exclude>com/test/somepackage/**/*.class</exclude>
<exclude>com/test/**/*Test.class</exclude>
</excludes>
</instrumentation>
</configuration>
</plugin>
</plugins>
</build>
mvn cobertura:cobertura   测试覆盖
mvn checkstyle:checkstyle 代码检查
mvn dashboard:dashboard 生成dashboard
mvn site:run




posted on 2012-02-17 11:45  leaving  阅读(408)  评论(0编辑  收藏  举报