user5722923
user5722923

Reputation: 33

adding multiple repositories in maven settings xml

I have tried to refer two repository from nexus in the setting.xml file, but it fails at first url and does not go to the next one. is there a mistiake in my xml.(nexus group does work, but we want to know the solution of how to work with diff repo in setting xml)

 <settings>
<servers>
   <server>
      <id>maven</id>
      <username>username</username>
      <password>password</password>
   </server>
      <server>
      <id>jenkins</id>
      <username>username</username>
      <password>password</password>
   </server>
</servers>
    <mirrors>
        <mirror> <!--This sends everything else to /public -snapshots-->
            <id>maven</id>
            <mirrorOf>*</mirrorOf>
            <url>https://nexus_example.net/repository/Maven_Proxy/</url>
            <!--<url>http://localhost:8081/repository/maven-proxy/</url>-->
        </mirror>
            <mirror> <!--This sends everything else to /public -snapshots-->
            <id>jenkins</id>
            <mirrorOf>*</mirrorOf>
            <url>https://nexus_example.net/repository/Jenkins_Proxy/</url>
            <!--<url>http://localhost:8081/repository/maven-proxy/</url>-->
        </mirror>
    </mirrors>
    <profiles>
        <profile>
            <id>nexus</id>
            <repositories>
                <repository>
                    <id>maven</id>
                    <url>https://nexus_example.net/repository/Maven_Proxy/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>jenkins</id>
                    <url>https://nexus_example/repository/Jenkins_Proxy/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>nexus</activeProfile>
    </activeProfiles>
</settings> 

Upvotes: 0

Views: 1798

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35795

Your first mirror is a <mirrorOf> everything, and so the second mirror is never used.

Upvotes: 1

Related Questions