Maven的几个常用plugin
作者:恒久地平线 时间:2021-12-05 13:36:28
maven-compiler-plugin
编译Java源码,一般只需设置编译的jdk版本
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
maven-dependency-plugin
用于复制依赖的jar包到指定的文件夹里
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
maven-jar-plugin
打成jar时,设定manifest的参数,比如指定运行的Main class,还有依赖的jar包,加入classpath中
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>/data/lib</classpathPrefix>
<mainClass>com.zhang.spring.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
来源:http://www.cnblogs.com/zhangxh20/p/6298062.html
标签:Maven,plugin
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
浅谈@RequestMapping注解的注意点
2023-07-11 02:12:39
Java设计模式之工厂模式实现方法详解
2023-11-26 07:55:51
Android中bindService基本使用方法概述
2023-08-05 19:18:56
![](https://img.aspxhome.com/file/2023/6/85446_0s.png)
Spring中IOC和AOP的深入讲解
2023-11-19 10:20:59
![](https://img.aspxhome.com/file/2023/9/59529_0s.jpg)
详解springboot和vue前后端分离开发跨域登陆问题
2023-08-07 00:48:38
使用Java实现qq邮箱发送邮件
2023-10-14 18:24:36
![](https://img.aspxhome.com/file/2023/1/58561_0s.jpg)
spring定时任务执行两次及tomcat部署缓慢问题的解决方法
2022-12-27 09:53:25
Java中的OkHttp使用教程
2023-08-10 19:30:59
浅析Mybatis 在CS程序中的应用
2023-06-24 08:44:15
![](https://img.aspxhome.com/file/2023/2/57422_0s.jpg)
java实现航空用户管理系统
2023-11-24 02:42:37
![](https://img.aspxhome.com/file/2023/9/59589_0s.png)
java 中sendredirect()和forward()方法的区别
2021-11-07 18:39:28
java实现支付宝支付接口的调用
2023-10-13 09:43:40
![](https://img.aspxhome.com/file/2023/1/58611_0s.jpg)
mybatis-plus 返回部分字段的解决方式
2023-03-25 14:45:04
![](https://img.aspxhome.com/file/2023/1/61281_0s.jpg)
SpringBoot整合mybatis的方法详解
2023-09-02 06:23:57
![](https://img.aspxhome.com/file/2023/5/58455_0s.png)
Java 处理超大数类型之BigInteger案例详解
2021-06-20 15:36:38
springboot配置文件中属性变量引用方式@@解读
2023-11-24 20:39:18
![](https://img.aspxhome.com/file/2023/6/59506_0s.png)
用SpringBoot+Vue+uniapp小程序实现在线房屋装修管理系统
2023-11-12 04:10:48
![](https://img.aspxhome.com/file/2023/3/58883_0s.png)
C++实现LeetCode(2.两个数字相加)
2023-06-23 16:51:11
Java技能点之SimpleDateFormat进行日期格式化问题
2023-09-09 01:50:26
![](https://img.aspxhome.com/file/2023/9/58339_0s.jpg)
SpringBoot如何使用自定义注解实现接口限流
2023-11-25 07:22:37
![](https://img.aspxhome.com/file/2023/0/60110_0s.png)