Configuring Multiple Nexus Repositories in a Spring Boot Project

20 Views Asked by At

I am currently developing a Spring Boot project, and I have configured two Nexus repositories in the settings.xml file as follows:

<repositories>
    <repository>
        <id>nexus-repo1</id>
        <url>http://nexus1.example.com/repository/maven-public/</url>
    </repository>
    <repository>
        <id>nexus-repo2</id>
        <url>http://nexus2.example.com/repository/maven-public/</url>
    </repository>
</repositories>

What I intend is that if a library defined in the pom.xml file is not available in nexus1, it should be fetched from nexus2. However, in reality, if a library is not found in nexus1, it does not fall back to nexus2.

What should I do in this case? I apologize for using a translation tool for asking the question as I am not proficient in English.

If the library exists in either nexus1 or nexus2, it should be fetched successfully.

0

There are 0 best solutions below