Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stop downloading libraries everytime

 
Minhaj Mehmood
Ranch Hand
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

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


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 400
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic