Maven无法下载Nexus服务器上的jar

        maven插件都已经部署好了,项目中配置的依赖也都可以下载,项目运行起来了!后面又要开发了几个项目,但是对之前的框架项目有依赖,就把前面的框架项目打成jar包,发布到nexus服务器上,但是本地就无法下载这个依赖,一直说missing artifact ***.jar。我就郁闷了,怎么就不行了,其它的jar都下载了啊,只能把相关的项目都下载下来,一个一个deploy,再运行。后来问我们老大可不下载么,老大说可以,在同事中都问了下,唯独我们老大的既可以deploy也可以下载依赖,我们其它几个人的都不行,经过老大个一番研究发现,原来就是注释了一段激活profile的代码,只要是profile成为活动的,那些代理服务器才会生效,原来如此,郁闷了很久,今天终于解决了,再也不用相关的项目。都下载下来,一个个deploy了。

<profile>
  <id>nexus</id>
  <repositories>
   <repository>
    <id>central</id>
    <url>http://central</url>
    <releases>
     <enabled>true</enabled>
    </releases>
    <snapshots>
     <enabled>true</enabled>
     <!--
     <updatePolicy>always</updatePolicy> 
     -->     
     <!--
     <checksumPolicy>ignore</checksumPolicy>
     -->
    </snapshots>
   </repository>
  </repositories>
  <pluginRepositories>
   <pluginRepository>
    <id>central</id>
    <url>http://central</url>
    <releases>
     <enabled>true</enabled>
    </releases>
    <snapshots>
     <enabled>true</enabled>
    </snapshots>
   </pluginRepository>
  </pluginRepositories>
 </profile>
  </profiles>

 

<!
  <activeProfiles>
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
  -->

只要将上面这段注释代码解开,这个profile就可以生效,就可以下载 依赖了,呵呵!

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值