How can I stop maven from checking for updates each time I start debugging a project from Eclipse? I hope this makes sense as I'm not too familiar with the java development environment.
It's just that everytime I start debugging, it will go checking for snapshot updates for dependent libraries. And this gets annoying on a slow internet connection.
When you run a Maven build, then Maven automatically downloads all the dependency jars into the local repository. It helps to avoid references to dependencies stored on remote machine every time a project is build. Maven local repository by default get created by Maven in %USER_HOME% directory.
This concept is known as "transitive dependency". Now, in order to "fill" the local repo maven has to download the jars to your local hard drive, that's why you see that it downloads a lot of stuff. So, answering your question, yes its normal maven behavior.
data-service project is releasing 1.0-SNAPSHOT for every minor change. Although, in case of SNAPSHOT, Maven automatically fetches the latest SNAPSHOT on daily basis, you can force maven to download latest snapshot build using -U switch to any maven command.
mvn clean install -U. -U means force update of snapshot dependencies. Release dependencies will be updated this way if they have never been previously successfully downloaded.
Use the -o
flag if you're using the command line. From mvn -h
:
-o,--offline Work offline
If you're using some sort of Maven integration like m2eclipse, the launch configurations usually have a 'Offline' check box.
Some might say that you're better of declaring release versions for all your plugins and dependencies, since that makes your build repeatable, i.e. instead of using
<version>1.0-SNAPSHOT</version>
use
<version>1.1</version>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With