Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip refreshing dependencies in gradle

Tags:

gradle

Short version of question: Is there a way of telling gradle not to resolve dependencies? I know I can skip single task with -x switch but resolving dependencies isn't performed though some task I guess, to I don't know how to do it.

Long version: Right now I can run tests from gradle with simple 'gradle test' which performs gathering dependencies, building and running tests.. But I'd also like to run tests using gradle on some other machine which can't download dependencies from maven. I thought that I could just perform some packaging which would download all dependencies to some lib folder, and I could expand tests classpath (in that task) to this folder. The problem is, that gradle still tries to contact maven when I run 'gradle myTests'. Is there a way of preventing resolving dependencies for this single task?

like image 425
mawek Avatar asked Jun 23 '13 14:06

mawek


1 Answers

There's the --offline flag. Alternatively, you can declare a flatDir rather than a maven repository whenever the build should be run with "local" dependencies.

like image 112
Peter Niederwieser Avatar answered Sep 19 '22 14:09

Peter Niederwieser