Is there a way to declare two nexus url in maven for searching single artifact

429 Views Asked by At

I'm trying to fetch an artifact from the nexus URL and I want maven to search for it in first Nexus URL and if it fails to find, it should look for it in the second URL.

To be precise I want to add multiple repositories for XL Deploy. Here's the format.

                  <deployables>
                        <was.War name="petclinic-war">
                            <contextRoot>petclinic</contextRoot>
                            <fileUri>maven:com.xebialabs.deployit.demo.petclinic:PetClinic:war:1.0</fileUri>
                             <tags>
                                <value>server1</value>
                             </tags>
                        </was.War>
                    </deployables>

Here's the link of the XL Deploy config page

2

There are 2 best solutions below

1
Vithursa Mahendrarajah On

You can specify multiple repositories as guided here like:

<repositories>
   <repository>
     <id>repo_1</id>
     <name>repo_1_name</name>
     <url>repo_1_url</url>
   </repository>
   <repository>
     <id>repo_2</id>
     <name>repo_2_name</name>
     <url>repo_2_url</url>
   </repository>
 </repositories>
0
Lionel Orellana On

This is easily configured in newer versions of XLD: https://docs.xebialabs.com/v.9.5/xl-deploy/how-to/configure-xl-deploy-to-fetch-artifacts-from-a-maven-repository

Alternatively, if you have a repository manager (e.g. nexus, artifactory) you can always proxy multiple repositories there and configure that in XLD.