上传jar包至maven私服

1.maven环境变量配置(新建系统变量,编辑Path)

2.修改maven的setting文件

2.1 私服的用户配置

2.2 私服镜像配置

2.3 (我也不知道是啥)

 1 <profile>
 2 <id>nexus</id>
 3 <repositories>
 4 <repository>
 5 <id>central</id>
 6 <url>http://central</url>
 7 <releases>
 8 <enabled>true</enabled>
 9 </releases>
10 <snapshots>
11 <enabled>true</enabled>
12 </snapshots>
13 </repository>
14 </repositories>
15 
16 <pluginRepositories>
17 <pluginRepository>
18 <id>central</id>
19 <url>http://central</url>
20 <releases>
21 <enabled>true</enabled>
22 </releases>
23 <snapshots>
24 <enabled>true</enabled>
25 </snapshots>
26 </pluginRepository>
27 </pluginRepositories>
28 </profile>
29 </profiles>
30 
31 <activeProfiles>
32 <activeProfile>nexus</activeProfile>
33 </activeProfiles>
View Code

3.在cmd中执行命令:

mvn deploy:deploy-file -Dfile=D:/springboot/db2jcc.jar -DgroupId=com.db2jcc -DartifactId=db2jcc -Dversion=11 -Dpackaging=jar -DrepositoryId=nexus -Durl=http://10.2.177.4:8081/nexus/repository/maven-releases

-Dfile:jar包在本地的路径

-DgroupId:对应于pom文件中的groupId

-DartifactId:对应于pom文件中的artifactId

-Dversion:对应于pom文件中的version

-Durl:私服的maven仓库

原文地址:https://www.cnblogs.com/ZnCl/p/7233589.html