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>
相关推荐
BD_Marathon16 小时前
【Python】初识迭代器
python
gz927cool16 小时前
Python 全栈应用最佳实践完整指南
开发语言·python·ai
CarIise16 小时前
Spring 框架:多配置文件、开发方式与 IOC 注解
junit·maven·jar
智购科技智能售货柜17 小时前
顾客已经关门,视觉售货柜还在处理旧画面:延迟积压怎么查?~YH
python·单片机·嵌入式硬件·物联网·eclipse
梯度下降者17 小时前
Python从0到100(三):Python中的变量介绍
python·作用域·变量·数据类型·计算机常识
AIFQuant17 小时前
Python期货行情API接入:股指、黄金、原油多品种数据管道实战
开发语言·python·金融·区块链·量化开发
威哥爱编程17 小时前
Python 智能体开发实战 07:让它查课表它张口就编?给 Agent 接上真正能动手的工具
python·agent
Wang's Blog17 小时前
Java 项目实战:交友项目 - 即时通信总结:全链路复盘、可复用清单与自检
java·python·交友
2601_9628857217 小时前
按主板/科创/创业/北交分板扫描选股
python
威哥爱编程17 小时前
Python 智能体开发实战 08:上线第一天就挂?给 Agent 装上重试、超时和降级三条保险丝
python·agent