Maven 打包时排除不想打包的文件&跳过测试
2012-09-06 14:09
423 查看
转自http://scorpio-jh.i.sohu.com/blog/view/151349557.htm
存着备忘
打包时不将资源文件夹下的文件打入包中
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<warSourceExcludes>src/main/resources/**</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
跳过测试
1. pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
2. 命令
mvn test -Dmaven.test.failure.ignore=true
mvn install -Dmaven.test.skip=true
按不同的配置参数打包:
mvn clean package -PtestServer
mvn clean package -Pdevelop
pom.xml
<profiles>
<profile>
<id>develop</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- local -->
<com.xxx.xxx.log.dir>D:\apache-tomcat-6.0.18\logs\</com.xxx.xxx.log.dir>
<com.xxx.xxx.upload.temp.dir>C:/temp</com.xxx.xxx.upload.temp.dir>
<com.xxx.xxx.node.image.root.url>http://127.0.0.1:8080/xxx_war/images/node/banner/</com.xxx.xxx.node.image.root.url>
<com.xxx.xxx.upload.node.image.savePath>D:/xxx/upload/images/node/banner/</com.xxx.xxx.upload.node.image.savePath>
</properties>
</profile>
<profile>
<id>testServer</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<!-- test server -->
<com.xxx.xxx.log.dir>/home/xxx/logs/</com.xxx.xxx.log.dir>
<com.xxx.xxx.upload.temp.dir>/home/xxx/upload/temp</com.unionread.publish.upload.temp.dir>
<com.xxx.xxx.node.image.root.url>http://192.168.1.1:8091/xxx_war/images/node/banner/</com.xxx.xxx.node.image.root.url>
<com.xxx.xxx.upload.node.image.savePath>/home/xxx/upload/images/node/banner/</com.xxx.xxx.upload.node.image.savePath>
</properties>
</profile>
</profiles>
存着备忘
打包时不将资源文件夹下的文件打入包中
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<warSourceExcludes>src/main/resources/**</warSourceExcludes>
</configuration>
</plugin>
</plugins>
</build>
跳过测试
1. pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
2. 命令
mvn test -Dmaven.test.failure.ignore=true
mvn install -Dmaven.test.skip=true
按不同的配置参数打包:
mvn clean package -PtestServer
mvn clean package -Pdevelop
pom.xml
<profiles>
<profile>
<id>develop</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- local -->
<com.xxx.xxx.log.dir>D:\apache-tomcat-6.0.18\logs\</com.xxx.xxx.log.dir>
<com.xxx.xxx.upload.temp.dir>C:/temp</com.xxx.xxx.upload.temp.dir>
<com.xxx.xxx.node.image.root.url>http://127.0.0.1:8080/xxx_war/images/node/banner/</com.xxx.xxx.node.image.root.url>
<com.xxx.xxx.upload.node.image.savePath>D:/xxx/upload/images/node/banner/</com.xxx.xxx.upload.node.image.savePath>
</properties>
</profile>
<profile>
<id>testServer</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<!-- test server -->
<com.xxx.xxx.log.dir>/home/xxx/logs/</com.xxx.xxx.log.dir>
<com.xxx.xxx.upload.temp.dir>/home/xxx/upload/temp</com.unionread.publish.upload.temp.dir>
<com.xxx.xxx.node.image.root.url>http://192.168.1.1:8091/xxx_war/images/node/banner/</com.xxx.xxx.node.image.root.url>
<com.xxx.xxx.upload.node.image.savePath>/home/xxx/upload/images/node/banner/</com.xxx.xxx.upload.node.image.savePath>
</properties>
</profile>
</profiles>
相关文章推荐
- Maven 打包时排除不想打包的文件&跳过测试
- Maven 打包时排除不想打包的文件&跳过测试
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
- 全网都找不到的maven-jar-plugin怎么排除不想打包的目录文件内容
- maven打包时跳过测试
- maven 打包跳过测试的方法
- maven 跳过测试 打包 及上传命令
- Maven打包跳过测试类
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
- maven打包排除部分文件
- eclipse maven 项目 打包跳过 测试 test 打包
- 文件打包 压缩(转)--测试成功
- maven打包时跳过测试
- Maven项目打包测试时如何跳过测试类
- (转)maven打包时跳过测试
- 【Java】Maven项目打包时候跳过执行测试用例
- maven打包时跳过测试
- maven打包时跳过测试
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
- Maven -- 在进行war打包时排除不需要的文件