Why do all my gradle tasks become really slow (longer than 5 minutes) when I add apache commons codec and apache commons io dependencies to my project? To be clear, executing the build task still works, but just takes a very long time. When it is slow, the gradle output is
resolving dependencies: 'classpath'
Below is the offending portion of my build.gradle:
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenCentral()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:0.5.0.M6")
classpath("org.mongodb:mongo-java-driver:2.11.3")
classpath("org.seleniumhq.selenium:selenium-java:2.37.1")
classpath("com.google.guava:guava:16.0.1")
classpath('commons-codec:commons-codec:1.9')
classpath("commons-io:commons-io:2.4")
}
}
If I do not include the last two classpath dependencies (codec and io), the buildscript is much faster. I am using gradle 1.10 via gradlew.
First question is do you really need to add all those dependencies to the Gradle script's classpath? Are these script plugin dependencies or your application's dependencies?
Your example looks quite different to the Spring Boot example. You are using a much older version of the Spring Boot Gradle plugin.
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