Simple maven deploy with credentials as arguments

If you don’t code day to day in some JVM language but you still need to use Maven for deploying artifacts from time to time, your best option is to use Maven docker image. However, credentials to your Maven repository are stored in .m2/settings.xml in your home folder which makes the standard Maven docker image harder to use.

If you just want to deploy an artifact, you can use image raget/maven-deployer.

docker pull raget/maven-deployer

It is pretty easy:

docker run -v <path_to_artefacts_folder>:/data mvn-deploy "<YOUR_REPO>"
 "-Drepo.login=<YOUR_USERNAME>" "-Drepo.pwd=<YOUR_PASSWORD>" "-Dfile=/data/"

Sometimes it … Continue reading.