문제

since it's sometimes really slow to download jars from a maven central repository, I want to backup my local maven repository and restore it in another computer and maybe even in another os.

I'm working in windows 7 now, so, do I just have to simply zip all the repository files in "C:\Users[username].m2\repository", and unzip it to the rep location in another computer to restore it? Or do I have to do something special?

Thanks for your answer.

도움이 되었습니까?

해결책

As far as i know that is all you have to do, maven does not store any special information in the repository. If you do this frequently, you could also use something like rsync to reduce the time and load of this.

And if you have many machines that need basically the same set of jars, consider using some local repository, like for example Artifcatory. You can set it up to work as a transparent cache, plus you can deploy your own artifacts on it.

다른 팁

You can just make a zip and copy it on another system. If you can't unzip the archive in the default maven repository location you can set the new location in your settings.xml

I would suggest to download an Repository manager like Nexus, Archiva an use that. So you can just drop your local repository and it will be downloaded the next time you build.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top