Search code examples
mavendependenciesmultiple-repositories

Take artifacts from multiple repositories with Maven


How can I configure a maven project to take one of the artifacts from a different repository?

I would like to include this in the project https://github.com/twitter/hadoop-lzo but I can find it only in the twitter repository, not on the central maven repository.


Solution

  • You can set the repositories you want to use in your settings.xml, or in your POM.

    If you have a team working on the project, you might want to put this in the POM so everybody has the conf.

    You can do it like :

    <repositories>
    
        <repository>
          <id>Maven Central</id>
          <url>http://repo1.maven.org/maven2/</url>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </repository>
    
    
    .... other repos
    </repositories>