maven 中 scope标签的作用以及引入本地jar包打包方法
1. scope标签的作用
2、使用system标签
项目三方jar存放位置结构:
pom.xml中引入三方jar:
<dependency>
<groupId>test</groupId>
<artifactId>testa</artifactId>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/test.jar</systemPath>
</dependency>
pom.xml中的打包构建配置:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<!-- 是否限制解压缩 -->
<executable>false</executable>
<mainClass>com.tuijie.gainguest.GainguestApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<!-- 用于排除三方jar包打包进入BOOT-INF/classes下(运行时是用不到的) -->
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<excludes>
<exclude>lib/*.jar</exclude>
</excludes>
</resource>
</resources>
</build>
重点:
<includeSystemScope>true</includeSystemScope>
和
<excludes>
<exclude>lib/*.jar</exclude>
</excludes>
本文作者:spiderMan1-1
本文链接:https://www.cnblogs.com/cgy1995/p/18343854
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
分类:
java知识点
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
2022-08-05 Mysql优化篇-索引优化与查询优化
2022-08-05 Mysql进击篇-存储引擎、索引、sql优化、视图、锁、innoDb、管理