Maven引用本地jar包

先上命令:

bash 复制代码
​
mvn install:install-file -Dfile=..\.m2\repository\jl1.0.1.jar -DgroupId="com.liz.local" -DartifactId="jl" -Dversion="1.0.1" -Dpackaging=jar

​

参数注释:

-Dfile: jar 包路径(建议放在 meven 的 repository)

-DgroupId: 指定group-id,确保 maven repository 下有对应的文件路径:

eg:"com.liz.local"<=>"\.m2\repository\com\liz\local\"

(注意带引号)

-DartifactId: aitifactId, 不带版本号的 jar 包名称(jl1.0.1.jar),注意带引号

-Dversion: 版本号**(注意带引号)**

使用:

html 复制代码
        <dependency>
            <groupId>com.liz.local</groupId>
            <artifactId>jl</artifactId>
            <version>1.0.1</version>
        </dependency>
相关推荐
zhongtianhulian1 分钟前
陶瓷行业导航网站:景德镇信息大全 — 采购指南与政策解读
人工智能·python
电子_咸鱼15 分钟前
常见面试题——滑动窗口算法
c++·后端·python·算法·leetcode·哈希算法·推荐算法
深圳佛手22 分钟前
jupyter notebook如何使用虚拟环境?
人工智能·python
Mqh18076233 分钟前
day38 gpu训练和call方法
python
ada7_1 小时前
LeetCode(python)230.二叉搜索树中第k小的元素
python·算法·leetcode·链表
江上鹤.1481 小时前
Day36官方文档的阅读
python
嗝o゚1 小时前
Flutter 无障碍功能开发最佳实践
python·flutter·华为
芝麻开门-新起点1 小时前
第13-1章 Python地理空间开发
开发语言·python
秋刀鱼 ..2 小时前
2026年电力电子与电能变换国际学术会议 (ICPEPC 2026)
大数据·python·计算机网络·数学建模·制造
睡觉早点2 小时前
IntelliJ IDEA下载安装过程(含Java环境搭建)
java·ide·jdk·maven·intellij-idea