How can I enforce Maven to only use my local repository and single specific repository on intranet and not downloading anything from internet? Even my POMs all has single company's internal repository specified, maven goes to internet repositories taken from libs' POM files to fetch dependencies.
This seems to be about using only your local (on own computer) repo, not about using an intranet (company) repo.
Kris
2010-07-02 10:44:09
Oh dear, use a file: URL to point at a local directory. That is a very bad idea.
tobrien
2010-07-09 06:36:43
It's actually not that bad, but everyone is entitled to an opinion...
Bozhidar Batsov
2010-07-09 08:37:09
+3
A:
In your settings.xml (usually under %user.home%/.m2) you can configure this.
E.g.
<mirrors>
<mirror>
<id>repo.example.com</id>
<mirrorOf>*</mirrorOf>
<name>Internal repo</name>
<url>http://repo.example.com/repo</url>
</mirror>
</mirrors>
The key part there is the <mirrorOf>*</mirrorOf>
which means that all requests will be directed at this repository.
Kris
2010-07-02 10:43:23
I've tried and it did worked out. I will wait a bit before marking this as solution, since it looks like hack - I was hoping for some specific option or cmd line param etc. Thanks for solving my practical issue anyways!
Igor Romanov
2010-07-02 13:53:50
This isn't a hack at all, this is how you configure a global repository manager. It is what we recommend people to do when they've setup something like Nexus.
tobrien
2010-07-09 06:35:51