Maven pom.xml 添加本地jar包依赖以及打包方法

  1. 安装到本地仓库

    mvn install:install-file -Dfile=D:\XX.jar -DgroupId=XX -DartifactId=XX -Dversion=1.11 -Production -Dpackaging=jar

2.dependency中指定scope="system"和本地jar包路径

(1)配置本地jar包依赖(systemPath指向本地jar包路径):

复制代码
<dependency>
  <groupId>XX</groupId>
  <artifactId>XX</artifactId>
  <version>1.11</version>
  <scope>system</scope>
  <systemPath>${project.basedir}/lib/xxx.jar</systemPath>
</dependency>

(2)在<build>的spring-boot-maven-plugin中设置将本地jar包导出到项目最终的依赖库中:

复制代码
<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <includeSystemScope>true</includeSystemScope>
  </configuration>
</plugin>
相关推荐
钱栈up1 天前
VSCode 调试多模块 Maven + Spring Boot 后端:从启动失败到一次跑通
java·spring boot·maven
砚底藏山河1 天前
【量化纯GET实战 #11】移动均线 MA:5 日 20 日 60 日怎么算怎么用
java·python·金融·maven
澈如冬雪^1 天前
IDEA导入已经下载的jar包
pycharm·intellij-idea·jar
马优晨1 天前
pom.xml 中 jquery webjars 依赖解释
xml·前端·jquery·jquery webjars·webjars依赖
云计算磊哥@2 天前
运维开发宝典064-CICD_Nexus3 搭建 maven 私服
运维·maven·运维开发
卓怡学长2 天前
w175基于springboot校园二手物品交易平台
java·spring boot·spring·maven·intellij-idea
楚识科技2 天前
定制 OCR 服务:非标证件与表格的 XML 字段映射实践
xml·ocr
wjjzhbb3 天前
中小团队敏捷转型:Scrum还是看板?
java·maven·scrum
光泽雨3 天前
JSON /XML转换
xml·json