maven常用插件配置
1、maven-jar-plugin插件 <!-- 排除资源文件中的properties文件,不需要打到jar中,后面通过assembly插件打包到conf目录中 --><plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <excludes> <exclude>**/*.properties</exclude> <exclude>**/*.xml</exclude> <exclude>**/*.conf</exclude> </excludes> </configuration></plugin> 这个插件通常不需要手动指定,默认mvn install 的时候就会运行,但是如果想排除某些资源文件,就需要手动指定一下了 2、maven-dependency-plugin<plugin> <!-- maven-dependency-plugin 会拷贝所有依赖的jar包,包括传递依赖的jar包都会拷贝 --> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy</id> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>lib</outputDirectory> </configuration> </execution> </executions></plugin>maven默认是不理会项目所依赖的jar包的,但是如果要发布项目,需要通过maven-dependency-plugin将项目所依赖的jar包输出到lib目录;maven-dependency-plugin 会拷贝所有依赖的jar包,包括传递依赖的jar包都会拷贝,比如项目依赖于a.jar,而a.jar的项目依赖b.jar,c.jar,那么maven-dependency-plugin会将a.jar,b.jar,c.jar一起拷贝到项目的lib目录 3、如果项目要发布源码,需要用到maven-source-plugin<!-- Source attach plugin --><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <executions> <execution> <id>attach-sources</id> <goals> <goal>jar</goal> </goals> </execution> </executions></plugin> 4、maven-release-plugin<!-- package release plugin --><plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>2.5</version></plugin>这个插件暂时还不知道有什么用 5、maven-Javadoc-plugin<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <executions> <execution> <id>attach-javadocs</id> <goals> <goal>jar</goal> </goals> </execution> </executions></plugin> 6、maven-war-plugin<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <webResources> <resource> <directory>src/main/webapp</directory> <excludes> <exclude>**/*.jpg</exclude> </excludes> </resource> </webResources> </configuration></plugin>这个插件通常不需要手动指定,默认mvn install 的时候就会运行,但是如果想排除某些资源文件,就需要手动指定一下了
tomcat插件
<plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <configuration> <path>/</path> <port>80</port> <uriEncoding>UTF-8</uriEncoding> <url>http://localhost/manager/text</url> <server>tomcat6</server> </configuration></plugin><plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> <version>1.1</version> <configuration> <path>/</path> <port>80</port> <uriEncoding>UTF-8</uriEncoding> <url>http://localhost/manager/text</url> <server>tomcat6</server> </configuration></plugin>代码规范检查插件<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <configuration> <configLocation>my_check.xml</configLocation> </configuration></plugin>my_check.xml : https://git.oschina.net/it-much/dubbo-demo/blob/master/dubbo-parent/my_check.xml?dir=0&filepath=dubbo-parent%2Fmy_check.xml&oid=8c10ce5ce32148fba20c847cbf5baf310f7826f2&sha=57d2861736831834d7d16a3c61c315b6dde14bda
资料: http://iffiffj.iteye.com/blog/1661936
http://zheng12tian.iteye.com/blog/1771040
maven常用插件配置的更多相关文章
- maven常用插件配置详解
常用插件配置详解Java代码 <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...
- Maven常用插件配置和使用
主要介绍Maven的几个常见第三方插件(cobertura.findbugs.source.assembly.插件开发)配置和使用,接Maven介绍 maven本质上是一个插件框架,它的所有工作都交给 ...
- maven常用插件pom配置
一.问题描述: 部署一个maven打包项目时,jar包,依赖lib包全部手动上传至服务器,然后用maven部署报错:Exception in thread "main" java. ...
- Maven常用插件简单配置
好久不见,甚是想念.一日不见,如隔三秋. 从春节到现在已经很久没有回归博客园了,今天回来温习一下maven常用的一些插件的配置,学东西一个很简单的诀窍就是重复重复再重复,这样一定能把知识掌握的很牢靠. ...
- Maven常用插件
maven利用各种插件来管理构建项目,本文记录下工作中常用到的插件及使用方法.每个插件都会提供多个目标(goal),用于标示任务.各插件配置在pom.xml里,如下: <build> [. ...
- maven常用插件总结
maven本质上是一个插件框架,几乎所有的功能都是通过各种各样的插件来实现的.maven默认会依据项目类型自动把构建时的各阶段(Lifecycle和phase)自动绑定(Lifecycle Mappi ...
- 日志分析平台ELK之日志收集器logstash常用插件配置
前文我们了解了logstash的工作流程以及基本的收集日志相关配置,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/13761906.html:今天我们来了解下l ...
- [maven] 常用插件解析
参考资料:http://my.oschina.net/zh119893/blog/276090 我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完 ...
- 【转】maven常用插件介绍
我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完成,例如编译源代码是由maven- compiler-plugin完成的.进一步说,每个任务对应 ...
随机推荐
- jQuery分析(1) - 介绍
前言 web技术高速发展到现在已经出了现非常多的库或框架,库或框架实现方法也是五花八门.现在要实现一个web站点只需要根据自己的业务需求选择js框架即可快速完成.有些框架可以快速满足业务需求,但是有些 ...
- 使用enable_shared_from_this示例
/*测试enable_shared_from_this*/ #include <iostream> #include <boost/smart_ptr/shared_ptr.hpp& ...
- PHP程序开发人员要掌握的知识
文件目录处理函数包80%以上的函数的功能的灵活运用. 日期时间函数中的80%以上的函数的功能的灵活运用 数学函数库中的100%的内容. 网络库中的60%以上的内容,对各个函数的功能比较熟悉. 字符串处 ...
- trac的安装和配置
trac是一个很好用的基于python的任务管理系统. 这个软件主要有如下特点: 1)tickit管理,可以设定各种各样的ticket,然后进行修改和完成. 2)wiki管理,可以编写各种文档. 3) ...
- WPF AutoGeneratingColumn 绑定下拉框
WPF自动产生列,前台代码: <DataGrid x:Name="Dg" AutoGenerateColumns="True" CanUserAddRow ...
- Centos6.5最小化安装:配置网络和自启动服务
参考http://www.111cn.net/sys/CentOS/56456.htm 1.开启网络连接,禁止IPV6启用 1.开启网络连接 vi /etc/sysconfig/network-sc ...
- webapp框架—学习AngularUI2(demo改造)
目的:把AngularUI的模板应用到“桂电在线”上 步骤如下: 按功能表修改demo界面 学习angularUI如何加载全部页面,为了设置自定义加载模板,在demo/demo.js中找到这一段 // ...
- MYSQL 错误 :Out of resources when opening file './datagather/mx_domain#P#p178.MYD' (Errcode: 24) 解决办法
出现Out of resources when opening file './xxx.MYD' (Errcode: 24)错误是因为打开的文件数超过了my.cnf的--open-files-limi ...
- HDU 5726 GCD (2016 Multi-University Training Contest 1)
Time Limit: 5000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64u Description Give y ...
- CocoaPods ADD private Spec Repo
Private Pods CocoaPods is a great tool not only for adding open source code to your project, but als ...