flower

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8

统计

开启禁止匿名用户访问私服后,从私服下载jar包的两种方式

①配置<server>和<profile>、<activeProfiles>

<server>
  <id>nexus</id>
  <username>访问的账号</username>
  <password>访问的密码</password>
</server>

 

<!--配置私服下载jar包的模板 开始-->
<profile>
  <!--profile的id-->
  <id>dev</id>
  <repositories>
    <repository>
       <!--仓库id,需要和server中的id一致,因为需要通过账号进行访问-->
       <id>nexus</id>
      <!--仓库地址,即nexus仓库组的地址-->
      <url>http://localhost:8081/repository/maven-public/</url>
      <!--是否下载releases构件-->
      <releases>
        <enabled>true</enabled>
      </releases>
      <!--是否下载snapshots构件-->
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
  <!-- 插件仓库,maven的运行依赖插件,也需要从私服下载插件 -->
    <pluginRepository>
      <id>public</id>
      <name>maven-public</name>
      <url>http://localhost:8081/repository/maven-public/</url>
    </pluginRepository>
  </pluginRepositories>
</profile>
<!--配置私服下载jar包的模板 结束-->

 

<!--激活下载模板->

<activeProfiles>
  <activeProfile>dev</activeProfile>
</activeProfiles>

 

 

②https://blog.csdn.net/qq_43302195/article/details/128684987

posted on   花已成海  阅读(165)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?
点击右上角即可分享
微信分享提示