How to disable "resolving dependencies"?

(Igor Popov) #1

My problem occurs only sometimes when building the project: gradle “resolves dependencies” which is great, but we are using our own artifactory which is unavailable sometimes (and it is also out of my control, but we need to use it).

Can I disable somehow the dependency checking? Here’s what happens exactly:

:myProject:compileJava Resource missing. [HTTP GET: http://artifactoryserver/artifactory/libs-releases/org.slf4j/slf4j-api/1.6.0/ivy-1.6.0.xml] Resource missing. [HTTP HEAD: http://artifactoryserver/artifactory/libs-releases/org.slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar] Resource missing. [HTTP GET: http://artifactoryserver/artifactory/libs-snapshots/org.slf4j/slf4j-api/1.6.0/ivy-1.6.0.xml] Resource missing. [HTTP HEAD: http://artifactoryserver/artifactory/libs-snapshots/org.slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar]

I already have in local all the libraries, but gradle keep checking them if they exist on the server. This takes a bit of time and I was looking if we could somehow lower the build time by disabling the dependency checking and doing it only on demand.

Is this possible? If so, how?

Thank you for your support!

(Igor Popov) #2

I found the answer eventually here:

It seems I had to pass gradle a new command line option called: ‘offline’. So it’s something like this: ‘gradle --offline’

(Tye Howard) #3

Have you tried using :

gradle --offline

(Peter Walker) #4

Did the offline mode work out for you?

(Igor Popov) #5

Yes. It did solve the problem.

(Peter Walker) #6