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>
相关推荐
金銀銅鐵2 小时前
[Python] 借助 turtle 逐字展示唐诗《金缕衣》
python
Python大数据分析@4 小时前
使用大模型MCP采集数据,爬虫已经无门槛
python·网络爬虫
quantdash_cc4 小时前
告别自建 Requests/BS4 网页爬虫:基于 QuantDash 搭建零维保的高性能量化行情流水线
开发语言·爬虫·python·pandas·量化·quantdash
65岁退休Coder5 小时前
LangChain v1.3.4 笔记 - 07 补充:链式调用 LCEL
后端·python·langchain
卷无止境5 小时前
FastAPI 部署在 Nginx 后面到底该怎么配
后端·python
半亩码田5 小时前
C#转Python第3.1篇:Python 的 class 没有访问修饰符?面向对象的另一条路
开发语言·python·c#
Wzx1980126 小时前
python沙箱和docker沙箱你选对了吗?
开发语言·python·docker
Python私教6 小时前
签名 URL 刷新导致审批失效?别急着删掉所有 query
python·安全
牧羊人.3336 小时前
Python 办公自动化从入门到入土|09 数据容器之字典
开发语言·python
Zane19946 小时前
类变量与实例变量:一个共享列表引发的线上事故
后端·python