I have jar files for my web application. I need to have those dependency jars in my local maven repository so that I can use them in my applications. It would be nice to run the local maven repo as a container in my development machine.
Asked
Active
Viewed 3,155 times
2
-
2If you intent to use it only on local machine, then what's wrong with `~/.m2/repository` ? I can't image what improvement would be to have it in container – rkosegi Jul 09 '18 at 12:21
-
I have to share it with my team. – Santhosh Tpixler Jul 09 '18 at 12:22
-
1nexus is available as a docker instance. Very easy to get started with. – Thorbjørn Ravn Andersen Jul 09 '18 at 16:30
-
Instead of running a docker container. Using a maven repository in the cloud might be easy. I use https://repsy.io for this purpose – Fırat Küçük Jun 04 '20 at 19:59
2 Answers
2
The usual approach (at least for companies) is:
- Run a Nexus/Artifactory on a company server that holds internal and external artifacts.
- Have a
settings.xml
that points to that Nexus.
The local repository is then only a cache for your Nexus, no need to run any containers.

J Fabian Meier
- 33,516
- 10
- 64
- 142
-
-
Never tried, but https://www.jfrog.com/confluence/display/RTF/Installing+with+Docker – J Fabian Meier Jul 09 '18 at 12:30
-
Running [Nexus OSS](https://hub.docker.com/r/sonatype/nexus3/#running) is match easier as it can be done using single container. Artifactory need more of them (if I remember correctly, it needs other for database) – rkosegi Jul 09 '18 at 12:34
0
I know this an old post, but we've been maintaining an easy-to-use Apache Archiva image for quite some time now. You should try it out if you're looking for something with a very small footprint that is easy to get running.
Archiva certainly isn't the most feature-rich maven repo out there, but it's dead simple, free, and you can run it in k8s quite easily.
That said, I agree with @fırat-kÜÇÜk. Unless you need to self host your maven repo, you really should just use a cloud hosted product. There's nothing easier than a subscription service.

Terence
- 706
- 9
- 22