1

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.

Razvi
  • 2,808
  • 5
  • 31
  • 39
  • 2
    Did you try adding the repo to your pom or settings file? – Dave Newton Feb 26 '13 at 09:18
  • Yeah, tried it again now and it works :). Don't know why I remembered that it didn't work when I tried it before. – Razvi Feb 26 '13 at 09:37
  • Maybe you encountered this issue : http://stackoverflow.com/a/10123184/709881 . – Samuel EUSTACHI Feb 26 '13 at 09:44
  • The second part : One ugly maven behavior you might encounter is that if you declare a dependency before you actually install it, maven will create an empty version of the missing dependency (folder with metadata but no jar), and you will have to manually clean your .m2 repository – Samuel EUSTACHI Feb 26 '13 at 09:46

1 Answers1

3

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>
Samuel EUSTACHI
  • 3,116
  • 19
  • 24