Newbie alert! Trying to understand gradle


(Arun Bose) #1

Hey, I’m trying to understand what is the deal with detachedConfiguration. I’ve added the dependency

runtime(‘com.oracle:ojdbc7:12.1.0.2’) but while gradle is trying to resolve the dependency, I see the below for the build.

Resolve dependencies :runtimeClasspath 52m 54s 949ms
Resolve dependencies :detachedConfiguration49 26m 16s 758ms
Resolve dependencies :detachedConfiguration50
Resolve dependencies :detachedConfiguration51 1ms
Resolve dependencies :detachedConfiguration52
Resolve dependencies :detachedConfiguration53 21s 23ms
Resolve artifact ojdbc7.pom (com.oracle:ojdbc7:12.1.0.2)

So what are these detachedConfiguration?

I’m a noob trying to figure out stuff.
Thanks in advance


(James Justinic) #2

There’s a detachedConfiguration(dependencies) method on the ConfigurationContainer. These are often used by plugins that internally need to resolve a dependency to do their work. As these configurations are an implementation detail of something in the build, they’re not added to ConfigurationContainer like the ones you’re expected to add dependencies to for your application.


(Arun Bose) #3

Thanks a tonne for answering that, So that means I need to revisit the plugins that have been added to my gradle? Also is it possible to exclude this, Cause as you see these steps take a lot of time during my first gradle build. It takes like an hour for resolving each of the detachedConfiguration and I can’t figure out why.


(James Justinic) #4

You can’t disable resolution of the detached configurations. These are hard dependencies for the code that uses them. If you don’t need what is creating them and configuring them, removing them is the answer. However, even the resolution of your runtimeClasspath seems ridiculously long. Are you in an extremely bandwidth limited environment?


(Arun Bose) #5

Hey Justin,

I get your point. The organisation has good bandwidth, although I’d assume it’s something to do with the proxy. I tried adding proxy to the IDE but it still takes time? Would it make sense if I post my build.gradle file here and see if I messed up something with the dependency plugins?


(James Justinic) #6

The more details you can provide to help with understanding what you have and what could impact what you’re seeing, the better. Although, it seems most likely we will only be able confirm what it’s not as reproducing your environment at the organization won’t be possible.