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 sti开发者_运维技巧ll remains , I would have to update that Repo with regular merges from an online source.
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.
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.
精彩评论