maven怎么安装第三方jar包到私服

 时间:2026-02-16 09:08:15

1、在maven的conf目录下的settings.xml配置文件中添加登录私服第三方登录信息<server><id>thirdparty</id><username>admin</username><password>admin123</password></server>

maven怎么安装第三方jar包到私服

2、打开cmd,进入jar包所在目录

maven怎么安装第三方jar包到私服

3、运行命令:

mvn deploy:deploy-file -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=1.1.37 -Dpackaging=jar -Dfile=fastjson-1.1.37.jar -Durl=http://localhost:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

maven怎么安装第三方jar包到私服

1、打开cmd直接运行命令:

mvn deploy:deploy-file -DgroupId=com.alibaba -DartifactId=fastjson -Dversion=1.1.37 -Dpackaging=jar -Dfile=(第三方jar包全路径名,例如:D:\fastjson-1.1.37.jar) -Durl=http://localhost:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

maven怎么安装第三方jar包到私服

1、DgroupId 和 DartifactId 构成了该 jar 包在 pom.xml 的坐标,项目就是依靠这两个属性定位。

自己起名字也行。

Dfile 表示需要上传的 jar 包的绝对路径。

Durl 私服上仓库的位置,打开 nexus——>repositories 菜单,可以看到该路径。

DrepositoryId 服务器的表示 id,在 nexus 的 configuration 可以看到。

Dversion 表示版本信息。

maven怎么安装第三方jar包到私服

1、包的名字上一般会带版本号,如果没有那可以解压该包,会发现一个叫 MANIFEST.MF 的文件,这个文件就有描述该包的版本信息。

maven怎么安装第三方jar包到私服

  • JAVA三大框架各自的作用是什么?
  • Hutool中如何截取字符串
  • 使用FastReport实现Web报表开发
  • weblogic11g的安装配置
  • vue-treeselect怎么使用
  • 热门搜索
    小学生国庆节手抄报 珍惜生命手抄报图片 我爱我家手抄报图片 关于古诗词的手抄报 防火防震手抄报 做文明人手抄报 法律进校园手抄报 消防手抄报资料 历史手抄报资料 手抄报排版设计