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!!
分享到:
相关推荐
maven-war-plugin-2.1.jar
maven-war-plugin-20030413.023708.jar
java运行依赖jar包
java运行依赖jar包
Maven-assembly-plugin是maven中针对打包任务而提供的标准插件,可以实现自定义打包。主要提供如下功能: ● 提供一个把工程依赖元素、模块、网站文档等其他文件存放到单个归档文件里。 ● 打包成指定格式分发包,...
maven-jar-plugin-3.1.1.jar
maven-war-plugin-2.0.1.jar
maven-war-plugin-2.0.jar
maven-war-plugin-1.6.3.jar
maven-war-plugin-2.0.2.jar
Spring Boot项目使用maven-assembly-plugin根据不同环境打包成tar.gz或者zip
maven-deploy-plugin-2.8.2.jar
maven是个项目管理工具,如果我们不告诉它我们的代码要使用什么样的jdk版本编译的话,它就会用maven-compiler-plugin默认的jdk版本来进行处理,这样就容易出现版本不匹配,以至于可能导致编译不通过的问题。...
java运行依赖jar包
maven-antrun-plugin-3.0.0.jar
maven-resources-plugin-2.4.1.jar
maven-install-plugin-2.4.jar
maven-site-plugin-3.3.jar
maven-deploy-plugin-2.7.jar
maven-resources-plugin-3.1.0.jar