morman456
morman456

Reputation: 11

Common Local repository for Maven

We want to maintain a common repository for Maven for all the systems within our local network, i.e., there should not be a .m2 directory on every system but on a common server(say with some local ip 172.<>). Can it be acheived via any file transfer protocol or any other service?

Operating System : Windows

Upvotes: 1

Views: 50

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35843

While this is actually possible (you can give Maven a settings.xml on the command line, so you can always point to the one in the network), I would strongly recommend against this:

The Maven local repository is not thread safe. When two guys build against it at the same time, anything might break, especially SNAPSHOT versions. I speak from experience: We tried to have only one local repository on our build server and we got wrong results in different builds.

If you want a repository for your team, you need Nexus or Artifactory.

Upvotes: 1

Related Questions