maven war plugin 2.2如何去掉不想打进去的包

Maven 打包时排除不想打包的文件&跳过测试 - / - ITeye技术网站
博客分类:
打包时不将资源文件夹下的文件打入包中 pom.xml
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-war-plugin&/artifactId&
&version&2.0.2&/version&
&configuration&
&warSourceExcludes&src/main/resources/**&/warSourceExcludes&
&/configuration&
&/plugins&
跳过测试,测试很烦人有时候因为测试打包失败了,纳闷我们就打包时候排除测试吧1.pom.xml
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-surefire-plugin&/artifactId&
&configuration&
&skip&true&/skip&
&/configuration&
mvn test -Dmaven.test.failure.ignore=true
mvn install -Dmaven.test.skip=true
liyonghui160com
浏览: 262180 次
来自: 北京
这个不能按照一条一条的读取数据。使用需要完善。
您好,我最近也在使用Canal,但是遇到了一个问题。ERROR ...
非常感谢!发现github里面的log4net版本太旧 ...
remzhang 写道帐号:密码:下次自动登录{url:/nForum/slist.json?uid=guest&root=list-section}{url:/nForum/nlist.json?uid=guest&root=list-section}
贴数:5&分页:玩命儿提高政治觉悟发信人: kabbesy (三冠王), 信区: Java
标&&题: 求教maven2咋能不打war包啊
发信站: 水木社区 (Wed Nov&&3 11:54:36 2010), 站内 && 执行默认package 任务的时候
可以不打war包,只输出exploded目录 && maven-war-plugin试了半天都不行
也没有skip && --
动心忍性,曾益其所不能&&&&&& ※ 来源:·水木社区 newsmth.net·[FROM: 124.205.138.*]
Zz...发信人: dev (&& ), 信区: Java
标&&题: Re: 求教maven2咋能不打war包啊
发信站: 水木社区 (Wed Nov&&3 12:45:27 2010), 站内 && 直接mvn compile war:exploded呗
为啥非要package, 改defaultGoal好像挺麻烦的 && 【 在 kabbesy (三冠王) 的大作中提到: 】
: 标&&题: 求教maven2咋能不打war包啊
: 发信站: 水木社区 (Wed Nov&&3 11:54:36 2010), 站内
: 执行默认package 任务的时候
: 可以不打war包,只输出exploded目录
: maven-war-plugin试了半天都不行
: 也没有skip
: 动心忍性,曾益其所不能&&
: ※ 来源:·水木社区 newsmth.net·[FROM: 124.205.138.*]
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&万物阴阳应对等,世途反极致偏斜。&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&经霜自有凌云意,勿做依人媚骨花。&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ——楓岫主人&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 222.130.186.*]
&发信人: Luxifero (Luxifero), 信区: Java
标&&题: Re: 求教maven2咋能不打war包啊
发信站: 水木社区 (Wed Nov&&3 12:55:43 2010), 站内 &&&&&&&&&& 用ant多好,非倒腾这破烂玩意
【 在 kabbesy (三冠王) 的大作中提到: 】
: 标&&题: 求教maven2咋能不打war包啊
: 发信站: 水木社区 (Wed Nov&&3 11:54:36 2010), 站内
: 执行默认package 任务的时候
: 可以不打war包,只输出exploded目录
: maven-war-plugin试了半天都不行
: 也没有skip
: 动心忍性,曾益其所不能&&
: ※ 来源:·水木社区 newsmth.net·[FROM: 124.205.138.*]
&&&& -- && ※ 来源:·水木社区 newsmth.net·[FROM: 211.103.181.*]
&一条叫java的鱼◎城内风光独好发信人: oldwatch (一条叫java的鱼◎谷歌将死,高墙早立), 信区: Java
标&&题: Re: 求教maven2咋能不打war包啊
发信站: 水木社区 (Wed Nov&&3 13:01:58 2010), 站内 && 用且仅用maven管理包依赖的飘过 && 【 在 Luxifero (Luxifero) 的大作中提到: 】
:&&&&&&&& 用ant多好,非倒腾这破烂玩意
public class FirstJava{ &&&&&&&& public static void main(String[] argv){ &&&&&&&&&&&&&&&& System.out.println("Hello,World!");&&&&&&&&}
Q:求救,为什么运行时说java.lang.NoClassDefFoundError错误?
A:java版精华区x-2-4-1 &&&& ※ 来源:·水木社区 newsmth.net·[FROM: 118.133.97.*]
兔子(male, married)发信人: personality (兔子(male, married)), 信区: Java
标&&题: Re: 求教maven2咋能不打war包啊
发信站: 水木社区 (Wed Nov&&3 13:29:13 2010), 站内 && maven少写配置
【 在 Luxifero (Luxifero) 的大作中提到: 】
:&&&&&&&& 用ant多好,非倒腾这破烂玩意
人啊 认识你自己&& 2009年愿望:
找一个女朋友(达成)
加薪 &&&& ※ 来源:·水木社区 ·[FROM: 218.107.160.*]
文章数:5&分页:maven war依赖war问题 -
- ITeye技术网站
我有个项目,下面2个子项目,一个core项目,一个web项目,由于core中有java代码和配置文件,而web项目也有java代码和各种web代码,web的java代码需要依赖core项目中java代码进行编译,我就不知道咋搞了。在网上搜到maven的maven-warpath-plugin插件。
我把core代码打成war包【这个已经执行成功】
然后web的pom.xml中添加
&&&&&&&&&&&&&&& &dependency&&
&groupId&com.hanweis.core&/groupId&
&artifactId&core&/artifactId&
&version&3.x-SNAPSHOT&/version&
&!-- &classifier&rest&/classifier& --&
&type&war&/type&
&/dependency&
&dependency&
&&& &groupId&com.hanweis.core&/groupId&
&artifactId&core&/artifactId&
&version&3.x-SNAPSHOT&/version&
&&& &type&warpath&/type&
&/dependency&
&&&&&&&&&&&&&&&&&&&&&& &plugin&
&groupId&org.appfuse.plugins&/groupId&
&artifactId&maven-warpath-plugin&/artifactId&
&version&2.1.0-M1&/version&
&extensions&true&/extensions&
&executions&
&execution&
&goal&add-classes&/goal&
&/execution&
&/executions&
但是编译时老是报错
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Unable to read local copy of metadata: Cannot read metadata from 'C:\Users\arthrun\.m2\repository\com\hanweis\core\core\3.x-SNAPSHOT\maven-metadata-jarvana.xml': only whitespace content allowed before start tag and not P (position: START_DOCUMENT seen P... @1:1)
& com.hanweis.core:core:warpath:3.x-SNAPSHOT
Path to dependency:
1) com.hanweis.web:web:war:3.x-SNAPSHOT
2) com.hanweis.core:core:warpath:3.x-SNAPSHOT
请各位大神援助一下,郁闷了一个星期了,到底我哪里出错了?
论坛回复 /
arthrunchen
浏览: 2735 次Maven 打包时排除不想打包的文件&跳过测试
打包时不将资源文件夹下的文件打入包中&
&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&
mvn test -Dmaven.test.failure.ignore=true mvn install -Dmaven.test.skip=true
按不同的配置参数打包:
mvn clean package -PtestServer
mvn clean package -Pdevelop
& &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-war-plugin 打包备忘 - 践行渐知 渐知践行 - ITeye技术网站
博客分类:
maven 各种插件要想用好还真是个技术活儿,不像ant那么方面,下面是我的模版
&groupId&org.apache.maven.plugins&/groupId&
&artifactId&maven-war-plugin&/artifactId&
&version&2.1.1&/version&
&configuration&
&packagingExcludes&**/spy.properties,scripts/ext4/docs/**,scripts/ext4/examples/**,scripts/ext4/pkgs/**,scripts/ext4/src/**,scripts/ext4/welcome/**,
scripts/jquery-ui/development-bundle/**,scripts/jquery-ui/extra/**,
scripts/jqgrid/src/**,scripts/jqgrid/plugins/**,
scripts/colorbox/example*/**,
scripts/jquery-fancybox/example/**,
scripts/masonry/doc/**,
scripts/poshytip/demo/**,
scripts/zTree/demo/**,
&/packagingExcludes&
&warSourceExcludes&
scripts/ext4/docs/**,scripts/ext4/examples/**,scripts/ext4/pkgs/**,scripts/ext4/src/**,scripts/ext4/welcome/**,
scripts/jquery-ui/development-bundle/**,scripts/jquery-ui/extra/**,
scripts/jqgrid/src/**,scripts/jqgrid/plugins/**,
scripts/colorbox/example*/**,
scripts/jquery-fancybox/example/**,
scripts/masonry/doc/**,
scripts/poshytip/demo/**,
scripts/zTree/demo/**,
&/warSourceExcludes&
&warSourceDirectory&WebContent&/warSourceDirectory&
&workDirectory&${project.build.directory}/work&/workDirectory&
&useCache&false&/useCache&
&addMavenDescriptor&true&/addMavenDescriptor&
&/archive&
&webXml&${basedir}/WebContent/WEB-INF/web.xml&/webXml&
&ignoreWebxml&false&/ignoreWebxml&
&warName&${project.build.finalName}&/warName&
&finalName&${project.build.finalName}&/finalName&
&webResources&
&resource&
&directory&WebContent/WEB-INF&/directory&
&filtering&true&/filtering&
&targetPath&WEB-INF&/targetPath&
&/resource&
&/webResources&
&/configuration&
这个可以正确打包,最后有个问题,默认maven war插件不会打包webapp下的空目录,google 之,发现没有好方法,最后发现,随便在空目录里放一个文件,maven 插件就会打包进去了,great idea!!
浏览 11234
浏览: 117374 次
来自: 陕西
您好,请问,我的已经出现:Generating grub.cf ...
分页的page类,只要写出来了,基本上都能通用吧楼主?
谢谢分享,学习了
为什么不直接这样?:select deptno from de ...
=。= LZ没怎么谈SpringMVC呀。╮(╯▽╰)╭

我要回帖

更多关于 maven war plugin配置 的文章

 

随机推荐