显示标签为“Maven”的博文。显示所有博文
显示标签为“Maven”的博文。显示所有博文

2014年2月17日星期一

mvn clean package -Dmaven.test.skip=true





Skip your tests with maven release plugin


The maven release plugin becomes often very handy. However, in its default configuration all relevent maven lifecycle phases are performed including the verify phase. Here, all your tests – if any available – are compiled and run as well. In my particular case, I just wanted to perform the release without the test steps.
This is what you need to do:
  1. Preparing   – mvn -DpreparationGoals=clean -DscmCommentPrefix="XXX" release:prepare
  2. Performing – mvn -Darguments="-Dmaven.test.skip=true" release:perform
The prepare goal will only perform the clean lifecycle. You may of course define other lifecycle phases as well unless they include testing activities. The perform goal is a different story. Here we make use of the arguments parameter providing some input for the underlying phases deploy and site-deploy run by the perform goal.
Cheers

2011年4月1日星期五

maven理解笔记

1、maven的生命周期 resources:resources--->compiler:compiler-->resources:testResources-->compiler:testCompile-->surefire:test-->jar:jar

2、maven的传递性依赖,在我们的项目中只需定义直接的依赖,maven会自动搜索并添加所有依赖并处理之间的冲突,在maven库中不仅有jar文件还有一个定义了依赖关系的pom文件,以实现依赖的查找。

3、依赖分为测试范围test 、编译范围compile、provided 范围(只在编译时使用,部署时已由容器提供,Servlet API 第三方开源实现Apache Geronimo org.apache.geronimo.specs)

4、配置jetty插件

<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
</plugin>
</plugins>

5、maven 插件

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>