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就可以生效,就可以下载 依赖了,呵呵!

猜你喜欢

转载自zjfshowtime.iteye.com/blog/1815181