Take artifacts from multiple repositories with Maven

Razvi picture Razvi · Feb 26, 2013 · Viewed 7.1k times · Source

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.

Answer

Samuel EUSTACHI picture Samuel EUSTACHI · Feb 26, 2013

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>