如何将本地jar包导入pom文件中?

有两种方法可以完成

第一种使用命令导入本地maven仓库
将包放到本地仓库根地址执行以下命令:
mvn install:install-file -Dfile=gateway-sms-1.0.jar -DgroupId=com.message.gateway -DartifactId=gateway-sms -Dversion=1.0 -Dpackaging=jar
-DgroupId, -DartifactId, -Dversion:指定了这个jar包在repository的安装路径以及版本

-DgroupId 自定义groupid
-DartifactId 自定义DartifactId
-Dversion 自定义版本
-Dpackaging 打包方式

第二种使用标签配置
在dependency标签中有个可以使用
标签内容可以填写 该包所在的绝对路径.

   <dependency>
            <groupId>kui-fr</groupId>
            <artifactId>kui-fr</artifactId>
            <version>4.0.0</version>
            <systemPath>E:/kuishensource/xx/fr-0.0.1-SNAPSHOT.jar</systemPath>
        </dependency>

猜你喜欢

转载自blog.csdn.net/weixin_43203363/article/details/109777221
今日推荐