Maven常用插件集合
来源:互联网 发布:淘宝店铺首页无法打开 编辑:程序博客网 时间:2024/06/10 23:20
在这里记录常用的插件,以备用时可快速查询,会持续更新
1. maven-compile-plugin
官方介绍 http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html
在pom.xml文件中默认编译级别是1.5,如果需改成1.6,可以在pom.xml中增加如下配置
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
extensions表示继续默认的配置,这里只是修改了编译jdk为1.6
2. maven-bundle-plugin
官方介绍 http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Export-Package>com.my.company.api</Export-Package>
<Private-Package>com.my.company.*</Private-Package>
<Bundle-Activator>com.my.company.Activator</Bundle-Activator>
</instructions>
</configuration>
</plugin>
3. maven-dependency-plugin
官方介绍 http://maven.apache.org/plugins/maven-dependency-plugin/
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.8</version> <executions> <execution> <id>copy-dependencies</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true<overWriterIfNewer>
<excludeArtifactIds>servlet-api<excludeArtifactIds> </configuration> </execution> </executions> </plugin>
这个配置可以把所有的依赖拷贝到lib目录下,通过maven-jar-plugin就可以将lib下面的jar包打到最终的jar里面
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <id>jar</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration> <classesDirectory>${project.build.directory}/lib</classesDirectory></configuration> </execution> </executions> </plugin>4. maven-war-plugin官方介绍:http://maven.apache.org/plugins/maven-war-plugin/<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <webResources> <resource> <!-- this is relative to the pom.xml directory --> <directory>resource2</directory><!--打包时包含这个目录的内容--><excludes> <!--排除一些目录--> <exclude>**/properties</exclude> </excludes></resource></webResources></configuration></plugin>
- Maven常用插件集合
- jquery 常用插件集合
- webstorm 常用插件集合
- atom 常用插件集合
- Elasticsearch常用插件集合
- Elasticsearch常用插件集合
- Elasticsearch常用插件集合
- 常用Maven插件介绍
- Maven常用插件
- Maven常用插件列表
- 常用Maven插件介绍
- Maven常用插件介绍
- 常用Maven插件介绍
- 常用Maven插件介绍
- 常用Maven插件介绍
- 常用Maven插件介绍
- 常用Maven插件介绍
- 常用Maven插件介绍
- MySQL索引类型一览 让MySQL高效运行起来
- java iterator 遍历删除容器
- 电脑双系统顺序的切换方法
- strtok函数及函数实现
- PHP性能优化大全(整理)
- Maven常用插件集合
- 分治法学习
- Qt pro文件使用
- IOS开发(108)之Quartz 2D绘图实例演示
- CoreText(三) CTFrameRef CTFramesetterRef CTLineRef
- 全营销:聚集三大媒体营销正能量
- TCP/IP - 函数到系统调用的过程
- 休闲小憩 康小孩的PROC问题
- JS跨域访问操作iframe