stimpy
stimpy

Reputation: 492

Merging maven .m2 repositories

I have a maven repository in an offline network.

I need to update its contents and merge in another repository .

What is the best method to do this ? I looked at the wagon plugin Wagon but I am concerned that there may be a better way.

I could replace my local repo with an offline repository manager but the problem still remains , I would have to update that Repo with regular merges from an online source.

Upvotes: 2

Views: 2515

Answers (2)

Brett Porter
Brett Porter

Reputation: 5867

Vincent's answer is correct, but I would more strongly suggest that you don't do this in the .m2/repository directory. That directory is a cache, and should be able to be removed at any time. You should consider setting up a repository manager (such as Archiva, Nexus or Artifactory, or just a HTTP server) and host the repository content there so that you can let Maven manage the .m2/repository directory.

Upvotes: 2

Vincent
Vincent

Reputation: 1035

If you can afford to get rid of all metadata (which should recover with the next mvn commands you run) for the time of your operation, just use rsync.

If building a concrete repository is not mandatory, consider using Nexus and its groups.

Upvotes: 2

Related Questions