安装jar包到本地maven仓库

时间:2023-03-08 20:56:21

1、打开cmd

直接输入一下命令

自己下载的jar包放在d盘根目录下,jar名字叫spring-context-support-3.1.0.RELEASE.jar

DgroupId后面写的是groupId

DartifactId后面写的是artifactId

Dversion后面写的的是version

mvn install:install-file -Dfile=D:\spring-context-support-3.1.0.RELEASE.jar -DgroupId=aa -DartifactId=bb -Dversion=3.1.0.RELEASE -Dpackaging=jar

执行命令

看到下图,安装成功

安装jar包到本地maven仓库

2、然后再项目中的pom.xml中引用

<dependency>  

   <groupId>aa</groupId>

    <artifactId>bb</artifactId>

    <version>3.1.0</version>

</dependency>