maven-war-plugin 打包备忘

maven 各种插件要想用好还真是个技术活儿,不像ant那么方面,下面是我的模版

<plugin>
				<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/**,
					logs/**
					</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/**,
					logs/**
					</warSourceExcludes>
					<warSourceDirectory>WebContent</warSourceDirectory>
					<workDirectory>${project.build.directory}/work</workDirectory>
					<useCache>false</useCache>
					<archive>
						<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>
			</plugin>

  

    这个可以正确打包,最后有个问题,默认maven war插件不会打包webapp下的空目录,google 之,发现没有好方法,最后发现,随便在空目录里放一个文件,maven 插件就会打包进去了,great idea!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值