Spring-boot和Gradle:构建时间太长 - 如何调试?

时间:2015-11-05 12:48:50

标签: java spring gradle build spring-boot

我有多部分项目,项目的API部分有大约10个依赖项。

尝试使用Spring Boot(bootRun)运行API项目,一切正常,但构建时间太长。我已尝试使用gradle paralleldaemon构建它,但它不起作用。

如何调试构建过程以了解需要多长时间?

更新

带有 - debug

gradle build进入此点并堆叠几分钟

13:53:54.215 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.003 secs) from Binary store in /private/var/folders/jg/94cgy2fs2mqckt3mx4fj52qm0000gn/T/gradle8000416708924643404.bin (exist: true)
> Building 0% > Resolving dependencies ':web-sb-api:runtime'

在这里堆叠2-3分钟,之后继续留下很长的痕迹......

13:55:50.902 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction] Initial dependency graph:
13:55:50.902 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction] tv.accedo.appgrid:web-sb-api
13:55:50.903 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.newrelic.agent.java:newrelic-api
13:55:50.903 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-core
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-annotations
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     com.fasterxml.jackson.core:jackson-databind
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]         com.fasterxml.jackson.core:jackson-annotations
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]         com.fasterxml.jackson.core:jackson-core
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     org.slf4j:slf4j-api
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     org.springframework:spring-core
13:55:50.904 [DEBUG] [io.spring.gradle.dependencymanagement.exclusions.ExclusionConfiguringAction]     org.springframework:spring-beans

1 个答案:

答案 0 :(得分:0)

您可以尝试使用-d--debug标志运行构建,以使用调试日志记录级别运行构建。可能是额外的输出将有助于找到原因,为什么你的构建运行这么久。