Closed petromir closed 3 years ago
Please see my existing comment on the IDEA issue. I don't believe there's anything more that can be done here, unfortunately.
Also what could be the negative effect on dependencies resolution if Maven exclusions processor is disabled?
You may see some dependencies on the classpath that would not appear if the project had been built with Maven. These dependencies can be removed using one of Gradle's standard exclusion mechanisms.
Just to make sure that I understand it right. Let's take this as an example:
compile(group: 'io.opentracing.contrib', name: 'opentracing-spring-jaeger-cloud-starter') {
exclude group: 'io.opentracing.contrib', module: 'opentracing-spring-cloud-redis-starter'
}
If I disable Maven exclusion with applyMavenExclusions = false
and I use another version of opentracing-spring-cloud-redis-starter
which is different from the one used in opentracing-spring-jaeger-cloud-starter
, then I will still have both versions in the classpath?
What you've shown above is an exclusion configured in your Gradle build and is unaffected by the applyMavenExclusions
setting. The setting only affects exclusions configured in the pom files of your project's dependencies. When enabled, those exclusions will be applied with Maven's semantics rather than Gradle's. This is covered in the reference documentation where the different semantics are illustrated with some examples.
Got it. I've enabled the dirty hack for IntelliJ Gradle build logging and I see a lot of failing http requests to get some pom files of some of our internal dependencies in Nexus. Do you think these failures could cause the slowness?
I can't really tell from that description. It's certainly possible, depending on how long each request is taking.
Thanks for clarification. I will post here if I have some findings, so we have some history.
@wilkinsona The issue was caused by missing massive amount of SNAPSHOT artifacts in our Nexus repository. Once we fixed this the time went from 3 minutes to 30 seconds
That's good to hear. Thanks for following up.
There is an open issue in IntelliJ (https://youtrack.jetbrains.com/issue/IDEA-255314) which is about slow synchronization of Spring Boot project when Gradle is used. According to IntelliJ developers the reason for this issue is in this plugin and more specifically dependency resolution
Their suggestion is
As a workaround, you can try disabling Maven Exclusions processor. Please note, that it may have effect on dependencies resolution result in your project.
which leads to https://docs.spring.io/dependency-management-plugin/docs/current/reference/html/#maven-exclusions-disabling.
I'm trying to understand what should be done from both parties - you and IntelliJ, in order to resolve the issue as it takes ~3 minutes on average Spring Boot project when a synchronization is required (changing dependency or build settings), compared to ~25 seconds building the project from terminal. Also what could be the negative effect on dependencies resolution if Maven exclusions processor is disabled?