wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes stop downloading libraries everytime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "stop downloading libraries everytime" Watch "stop downloading libraries everytime" New topic
Author

stop downloading libraries everytime

Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

Hi Folks,

How to stop downloading the libraries(mentioned into pom) every time when you run/compile/test the project??




SCJP6 96% | SCWCD5 81% | SCDJWS5 79%
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

If it's downloading *every* time then something is wrong--once the library is in your local repository it shouldn't need to download anything unless a dependency changes.
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

David Newton wrote:If it's downloading *every* time then something is wrong--once the library is in your local repository it shouldn't need to download anything unless a dependency changes.


yes it's download everytime and that's making my compilation process too slow!!


what could be the problem any hint??
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

mvn dependency:go-offline
This is to prepare for compiling off-line
mvn <phase or goal> -o
This to instruct Maven to run in off-line mode
Minhaj Mehmood
Ranch Hand

Joined: Jan 22, 2007
Posts: 400

John Todd wrote:\
mvn <phase or goal> -o
This to instruct Maven to run in off-line mode


GREAT HELP!! THANK YOU JOHN
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It still shouldn't be downloading every time, and depending on how the POM is set up, this might not be the desired solution, though.
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

I'm not a Maven ninja but I think Maven will try to reach the internet every time, it may not download a dependency but it will hit the network any way.
This is why I run the two previous commands when using Maven.
Any way, I'm investing a little in Gradle build tool these days, I think it is more practical than Ant, Gant and Maven
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Yes, it'll go to the network--that's its job. But it shouldn't download the dependencies each time, unless both (a) the dependency versions aren't explicitly listed in the POM (in which case it will get latest) and (b) the dependencies are wildly updating themselves (possible, but not probable). Or something's wrong with the local repository and it's getting cleaned out over and over (more probable than (b)).

IMO something's wrong with the OP's setup and/or POM and/or cmdline. Going offline is certainly a solution, but may not be the most desirable one--that's all I'm saying.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: stop downloading libraries everytime
 
Similar Threads
Stop package installation
WA#2 word association
c:if won't accept any attributes!
Extending Struts tags
File not found error