什么是maven的私服就是把自己写的工具类共享给别人这样大家都能用到你写的工具类不用重复写提示效率

maven的上传与下载示意图
1.什么是发行版本?发行版本指定的是功能稳定可以共大家使用的版本
2.什么是快照版本?快照版本指定的是指正在开发的版本
3.central表示中央仓库就是外部的仓库

刚创建好的版本默认是快照版本想要修改版本version标签这里直接修改就好了

私服的使用
1.找到maven的配置文件

2.点击进去在servers标签设置私服用户名和密码
<server>
<id>maven-releases</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>maven-snapshots</id>
<username>admin</username>
<password>admin</password>
</server>

3.在mirrors标签设置私服的访问地址 需要将原来的阿里云地址注释掉
<mirror>
<id>maven-public</id>
<mirrorOf>*</mirrorOf>
<url>localhost:8081/repository/maven-public/</url>
</mirror>

4.在profile标签设置不管snapshots仓库还是releases仓库都可以下载依赖
<profile>
<id>allow-snapshots</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>maven-public</id>
<url>localhost:8081/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>

5.在pom配置文件里配置私服地址
<!--填写私服存放地址-->
<distributionManagement>
<repository>
<id>maven-releases</id>
<!--这里写私服存放地址-->
<url>localhost:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>maven-snapshots</id>
<!--这里写私服存放地址-->
<url>localhost:8081/repository/maven-releases/</url>
</snapshotRepository>
</distributionManagement>
6.releases和snapshots需要和maven配置文件需要一 一对应

![[计算机网络]--五种IO模型和select](https://img-blog.csdnimg.cn/direct/9c5200a6465b49a7a53f66f56710f8ab.png)


















