Skip to content

Instantly share code, notes, and snippets.

@misTrasteos
Created February 12, 2021 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save misTrasteos/36ef4edd8443acb826bf100b416ca79e to your computer and use it in GitHub Desktop.
Save misTrasteos/36ef4edd8443acb826bf100b416ca79e to your computer and use it in GitHub Desktop.
Download all maven dependencies into a folder using maven docker image

how to run

run this container from the root of your maven project.

docker run -it --rm -v "$(pwd)/dependencies":/root/.m2 -v "$(pwd)":/usr/src/mymaven -w /usr/src/mymaven maven mvn dependency:go-offline

All dependencies will be downloaded in this directory

tree -L 2 dependencies
dependencies
├── copy_reference_file.log
├── repository
│   ├── aopalliance
│   ├── asm
│   ├── backport-util-concurrent
│   ├── classworlds
│   ├── com
│   ├── commons-beanutils
│   ├── commons-cli
│   ├── commons-codec
│   ├── commons-collections
│   ├── commons-digester
│   ├── commons-io
│   ├── commons-lang
│   ├── commons-logging
│   ├── commons-validator
│   ├── io
│   ├── jakarta
│   ├── javax
│   ├── jline
│   ├── junit
│   ├── log4j
│   ├── org
│   ├── oro
│   ├── software
│   ├── xml-apis
│   ├── xmlpull
│   └── xpp3
└── settings-docker.xml

links

Apache Maven Docker image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment