1、准备

 (1) 确保本地maven环境已配置

 (2) 搭建maven私库,参考博客【使用nexus搭建maven私有仓库】

2、本地打包

以个推jar包为例

【Maven】打包本地第三方jar到私库

(1) 使用cmd打包,执行以下命令:

# mvn deploy:deploy-file -Dmaven.test.skip=true -Dfile=G:\libs\gexin-rp-sdk-http-4.1.1.4.jar -DgroupId=com.gexin.platform -DartifactId=gexin-rp-sdk-http -Dversion=4.1.1.4 -Dpackaging=jar -DrepositoryId=maven-releases -Durl=http://192.168.31.88:8081/repository/maven-releases/

命令注释:

-Dmaven.test.skip=true                                    //跳过编译、测试
-Dfile=D:\lib\gexin-rp-sdk-http-4.1.1.4.jar         //jar包文件地址,绝对路径
-DgroupId=com.gexin.platform                        //gruopId--pom坐标,自定义
-DartifactId=gexin-rp-sdk-http                          //artifactId--pom坐标,自定义
-Dversion                                                         //版本号
-Dpackaging                                                    //打包方式
-DrepositoryId                                                 //远程库服务器ID
-Durl                                                                //远程库服务器地址

(2) 使用管理界面上传jar包

【Maven】打包本地第三方jar到私库

3、maven仓库查看

【Maven】打包本地第三方jar到私库

4、pom文件引用

【Maven】打包本地第三方jar到私库

 

相关文章:

  • 2021-08-27
  • 2021-12-25
  • 2021-07-14
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-25
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-09-27
  • 2021-11-29
  • 2021-12-06
相关资源
相似解决方案