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>
相关推荐
Tizzy JJ3 小时前
Python + pytest 接口自动化测试框架实战:从零搭建企业级项目骨架
开发语言·python·pytest
海兰3 小时前
【 Python 量化交易】第8章:量化工具箱
开发语言·python
TheBestRucy3 小时前
Python九阳神功之柒:数据分析三剑客·执剑问道
开发语言·python·数据分析
TheBestRucy4 小时前
Python九阳神功之陆:数据库持久化与缓存·乾坤大挪移
数据库·python·缓存
坐吃山猪4 小时前
IDEA调试中Evaluate常用操作
java·python·intellij-idea
Tizzy JJ4 小时前
接口自动化测试实战:如何围绕真实业务场景设计高质量用例
python·自动化·pytest
海兰4 小时前
【 Python 量化交易】第10章:八大经典策略
android·python·kotlin
IT码农-爱吃辣条4 小时前
Milvus 向量数据库 Python 实战教程
数据库·python·milvus
这个人懒得名字都没写4 小时前
OpenCV 官方教程中的测试图片Can’t find required data file
python·opencv