用命令将本地jar包导入本地maven仓库中

例如我们需要将下面pom文件中的的jar包引入本地仓库

<dependency>
    <groupId>com.hk</groupId>
    <artifactId>kafka</artifactId>
    <version>1.0.0</version>
</dependency>

导入命令

mvn install:install-file -Dfile=D:\kafka-sdk-1.0.1.RELEASE.jar -DgroupId=com.hk -DartifactId=kafka -Dversion=1.0 -Dpackaging=jar

命令详解

-Dfile:jar包所在本地的具体路径

-DgroupId:项目组织唯一的标识符,实际对应JAVA的包的结构。dependency标签中groupId标签内容

-dependency:项目的唯一的标识符,dependency标签中artifactId的内容

-Dversion:版本号,dependency标签中version的内容

-Dpackaging:打包的类型

猜你喜欢

转载自blog.csdn.net/qq_40386113/article/details/109550141