`
kjj
  • 浏览: 169352 次
  • 性别: Icon_minigender_1
  • 来自: 陕西
社区版块
存档分类
最新评论

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
2
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics