配置阿里云代理

防止原文被删记录下

image.png
image.png

阿里maven地址:https://maven.aliyun.com/repository/public

image.png
image.pngimage.pngimage.png

项目的jar上传到nexus

防止原文被删记录下

  • 😎maven setting文件

    1. <servers>
    2. <server>
    3. <id>releases</id>
    4. <username>admin</username>
    5. <password>admin</password>
    6. </server>
    7. <server>
    8. <id>snapshots</id>
    9. <username>admin</username>
    10. <password>admin</password>
    11. </server>
    12. </servers>
  • 👏项目父pom

    1. <!-- 项目发布管理 -->
    2. <distributionManagement>
    3. <repository>
    4. <id>releases</id>
    5. <name>detabes-component-Release</name>
    6. <url>http://192.168.0.3:8081/repository/maven-releases/</url>
    7. </repository>
    8. <snapshotRepository>
    9. <id>snapshots</id>
    10. <name>detabes-component-SNAPSHOTS</name>
    11. <url>http://192.168.0.3:8081/repository/maven-snapshots/</url>
    12. </snapshotRepository>
    13. </distributionManagement>

    image.png

  • 开始上传

image.png

  • 查看上传

image.pngimage.pngimage.png

在项目上使用

我开启了匿名访问的模式所以不用设置用户密码

  • 如果没有设置匿名 需要在maven setting文件中设置密码

    • 设置方式参考上面(最好新建一个账户,不要用admin)
    • Nexus配置可以匿名访问

      nexus私库的使用 - 图12

  • (二选一)setting 文件中添加使用 ```xml
  1. <mirror>
  2. <id>detabesnexus</id>
  3. <name>detabesnexus maven</name>
  4. <url>http://127.0.0.1:8081/repository/maven-public/</url>
  5. <mirrorOf>central</mirrorOf>
  6. </mirror>
  1. - 非匿名参考[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)
  2. - (二选一)pom 添加使用
  3. ```xml
  4. <repositories>
  5. <repository>
  6. <id>local-nexus</id>
  7. <url>http://192.168.0.3:1100/repository/maven-public/</url>
  8. <releases>
  9. <enabled>true</enabled>
  10. </releases>
  11. <snapshots>
  12. <enabled>true</enabled>
  13. </snapshots>
  14. </repository>
  15. </repositories>