配置阿里云代理
防止原文被删记录下
项目的jar上传到nexus
防止原文被删记录下
😎maven setting文件
<servers>
<server>
<id>releases</id>
<username>admin</username>
<password>admin</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin</password>
</server>
</servers>
👏项目父pom
<!-- 项目发布管理 -->
<distributionManagement>
<repository>
<id>releases</id>
<name>detabes-component-Release</name>
<url>http://192.168.0.3:8081/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>detabes-component-SNAPSHOTS</name>
<url>http://192.168.0.3:8081/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
开始上传
- 查看上传
在项目上使用
我开启了匿名访问的模式所以不用设置用户密码
如果没有设置匿名 需要在maven setting文件中设置密码
- 设置方式参考上面(最好新建一个账户,不要用admin)
Nexus配置可以匿名访问
- (二选一)setting 文件中添加使用 ```xml
<mirror>
<id>detabesnexus</id>
<name>detabesnexus maven</name>
<url>http://127.0.0.1:8081/repository/maven-public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
- 非匿名参考[settings.xml](https://www.yuque.com/attachments/yuque/0/2021/xml/1642320/1615253224210-17343d5b-57ec-4478-a793-369809012984.xml?_lake_card=%7B%22uid%22%3A%221615253222980-0%22%2C%22src%22%3A%22https%3A%2F%2Fwww.yuque.com%2Fattachments%2Fyuque%2F0%2F2021%2Fxml%2F1642320%2F1615253224210-17343d5b-57ec-4478-a793-369809012984.xml%22%2C%22name%22%3A%22settings.xml%22%2C%22size%22%3A2415%2C%22type%22%3A%22text%2Fxml%22%2C%22ext%22%3A%22xml%22%2C%22progress%22%3A%7B%22percent%22%3A99%7D%2C%22status%22%3A%22done%22%2C%22percent%22%3A0%2C%22id%22%3A%22HftyN%22%2C%22card%22%3A%22file%22%7D)
- (二选一)pom 添加使用
```xml
<repositories>
<repository>
<id>local-nexus</id>
<url>http://192.168.0.3:1100/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>