I have a gradle project and I use Intellij idea's IDE(version 14). I use my local gradle distribution(version 2.2). When I press the button to refresh all gradle projects, building takes too long but it finishes successfully every time I run it. My repository is on the company's local server. Is it normal?
In multi-build gradle where you have many sub modules, I just had this problem and I fixed it by doing this:
First click "Gradle refresh" and watch very closely at each project as it says "Resolving dependencies for (project name) (configuration)". If any of those are taking more than 200ms to complete, then check those projects for a unnecessarily large classpath dependency tree... because it is probably massive when you didn't mean it to be.
This in my case was because every project shared a :shared
project and that project had people dumping every dependency you could ever think of as a compile time dependency. So some sub-project that did some minor thing had dependencies from all the other projects basically. It was taking over 1 second to refresh the dependencies for each sub project which really totaled up.
The solution was to switch to transitive = false
on that shared project and manually add the dependencies that each project actually needs.
If you have fixed it, you'll no longer see 1-2 second delay when "Resolving dependencies" comes up. They should shoot through very quickly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With