簡體   English   中英

沒有在多個倉庫中搜索Maven

[英]Multiple repositories not being searched for maven

在我的settings.xml中,我已經配置了-

<mirrors>
     <mirror>
                        <id>lon33881xus</id>
                        <name>Project Nexus Repo</name>
                        <url>http://lonrs08358:9093/nexus/content/groups/public</url>
                        <mirrorOf>central,maven2-repository.dev.java.net,thirdparty1</mirrorOf>
                </mirror>

        <mirror>
            <id>lon80813</id>
            <mirrorOf>*</mirrorOf>                <url>http://lon3388x1us:1083/nexus/content/groups/public</url>
                </mirror>
                 <mirror>
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://lonrs03296:1081/nexus/content/repositories/riskit_common_snapshot/</url>
        </mirror>
<!--<mirror>
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://m2.neo4j.org/content/repositories/releases/</url>
                </mirror> -->
    </mirrors>

但是仍然在maven構建運行時,僅對第一個存儲庫進行jar填充,然后構建失敗,因為它無法找到第二個存儲庫中存在的jar。 我希望在第1個存儲庫中搜索jar,如果找不到,則在第2個中搜索。 我是新手,請幫忙。

最好的選擇是將您的本地關系配置為使用http://m2.neo4j.org/content/repositories/releases 將此站點添加到nexus作為proxy

然后,您的配置應如下所示:

<settings>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://lonrs08358:9093/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></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>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>

之后,所有操作均在后台進行。 當您的本地關系庫沒有庫時,它將從代理服務器下載,然后您也應該在本地存儲庫中接收該庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM