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>
相关推荐
Yolanda_202236 分钟前
Python学习-第九部分-错误处理与异常处理
开发语言·python·学习
这个人懒得名字都没写1 小时前
Flask + PyArmor Gunicorn启动报错:RuntimeError: unauthorised use of script
python·flask·gunicorn·pyarmor
C++、Java和Python的菜鸟1 小时前
第10章 后端Web进阶(Maven高级)
开发语言·python
暗黑小白2 小时前
路由策略与引擎可替换性
后端·python·ai agent
小罗水2 小时前
第 20 章 高级 RAG 技术与检索优化
人工智能·python·机器学习
bamb002 小时前
一个项目带你入门AI应用开发06
python
liwulin05062 小时前
【ESP32S3】调用百度云语音合成接口后重启
python
m沐沐2 小时前
【机器学习】矿物识别系统实战——六种填充方法×六种模型全面对比
人工智能·python·深度学习·机器学习·矿物识别
软糖姐姐3 小时前
Python:__closure__ 详解
python·闭包·__closure__·自由变量·cell对象
月光船幽幽3 小时前
四层公理框架驱动AI健康诊断
人工智能·python·科技·算法·安全