java项目之pom文件中如何添加(引入)本地jar呢?
下文笔者讲述pom中引入本地jar包的方法分享,如下所示
实现思路:
1.在项目下新建一个文件夹用于放置jar包
1.将jar包放入新建的文件夹中
3.编辑pom 文件
例:
<dependency>
<groupId>xxxxxx</groupId>
<artifactId>xxxx</artifactId>
<version>xxx</version>
<scope>system</scope>
<systemPath>${pom.basedir}/libs/xxxxx.jar</systemPath>
</dependency>
另在pom.xml文件,
增加一行配置
使其在编译jar包时
加载系统范围内的包
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.9.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
版权声明
本文仅代表作者观点,不代表本站立场。
本文系作者授权发表,未经许可,不得转载。


