Problem
I am building a Maven project inside a Docker container. I want the initial build to be quick. However, since during the first build, the ~/.m2 folder is empty, Maven downloads all the specified dependencies, and this process takes a while.
Question
Is there a way to somehow bundle all the dependencies in one jar file ( or something similar), and simply use that while building the project?
Notes
Note 1. The dependencies of this project will probably not change frequently.
Note 2. The reason the build happens inside the container is that depending on some user actions, the resource files are dynamically changed, thus each build generates a JAR file with a different set of resource files. This is the reason why I cannot just build the JAR beforehand, and simply use it inside the container.
Note 3. This container will be run by people other than me, so I cannot simply try mounting the local ./m2 directory to the container to speed up the process.
Thanks, and let me know if there are any questions.