1
votes

Is there any mechanism that if i keep all the pom dependencies locally at some path that everytime it gets picked from that path when i run Spring Boot app from command line? Example: Everytime i dont't want to donwload the pom dependencies from repository as below and want to keep somewhere locally for use. Downloading from central: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.3.3.RELEASE/spring-boot-starter-parent-2.3.3.RELEASE.pom

1
This is done automatically. You have a local repository under $HOME/.m2/repository where all dependencies are automatically stored. Only the first time they will be downloaded.... - khmarbaise
yes, Once you download on the first time. It stored in the local repo at ~/.m2. You don't need internet to run and download again unless you delete/rename ~/.m2 lol. Sometimes you can manually install maven manually by copy by yourself base on group and artifact id of your dependencies (you have jar files but no internet) - Toàn Nguyễn Hải

1 Answers

0
votes

I feel your question is a bit strange because it describes the main feature of maven. When building a project with maven, all the dependencies required by your project are downloaded into a local repository. Future builds won't download again those dependencies.

When running a springboot application using maven, the downloaded dependencies are provided to the application's classpath so they aren't downloaded again.

When running a packaged springboot application, the dependencies are already inserted in the springboot fat jar so they aren't downloaded again.

Another point, if you want to ensure maven does not download anything you can execute maven in "offline mode" using the following parameter "-o"