枫中畅游 2012-12-14 21:10
浏览 283
已采纳

nexus搭建maven私服的问题

使用nexus搭建私服,在settings.xml 里面配置了如下的片断:

nexus
http://localhost:8081/nexus/content/groups/public
*

现在我的项目需要下载新的jar包时,nexus只会在本地找一遍,找不到就报错了,如何能让nexus先找本地,找不到时再去其他仓库去找呢,目前public 这个group包括了Central,Apache Snapshots等其他仓库,是否是哪里配置不对,望指教,谢谢:)

  • 写回答

2条回答 默认 最新

  • henghanan 2012-12-14 21:43
    关注

    少配置了几个
    [code="java"]<!-- 设置镜像 -->

    central
    *
    Human Readable Name for this Mirror.
    http://localhost:8081/nexus/content/groups/public/



    central-repos

      <repositories>
        <repository>
          <id>central</id>
          <name>central</name>
          <url>http://central</url>
          <releases>
            <enable>true</enable>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
    


    central-repos
    [/code]

    其实,如果你只是一个人开发的话,不配置nexus也行的,只要在项目中的pom.xml配置
    [code="java"]

    maven
    Maven Repository Switchboard
    default
    http://repo.maven.apache.org/maven2/

    false


    [/code]maven在本地找不到jar包,会自动到网上去找

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?