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>
相关推荐
nimadan121 小时前
**手机小说扫榜工具2025推荐,精准追踪榜单动态与题材风向
python·智能手机
编程武士1 小时前
Python 各版本主要变化速览
开发语言·python
傻啦嘿哟1 小时前
Python中的@property:优雅控制类成员访问的魔法
前端·数据库·python
sky17202 小时前
VectorStoreRetriever 三种搜索类型
python·langchain
旦莫2 小时前
Python测试开发工具库:日志脱敏工具(敏感信息自动屏蔽)
python·测试开发·自动化·ai测试
唐叔在学习2 小时前
Python自动化指令进阶:UAC提权
后端·python
旺仔小拳头..2 小时前
Java ---变量、常量、类型转换、默认值、重载、标识符、输入输出、访问修饰符、泛型、迭代器
java·开发语言·python
wujj_whut3 小时前
【Conda实战】从0到1:虚拟环境创建、多Python版本管理与环境切换全指南
开发语言·python·conda
geoqiye3 小时前
2026官方认证:贵阳宠物行业短视频运营TOP5评测
大数据·python·宠物
龙腾AI白云3 小时前
AI智能体搭建(3)深度搜索智能体如何搭建与设计 Agent#智能体搭建#多智能体#VLA#大模型
python·django·virtualenv·scikit-learn·tornado