Skip to content

Commit ead6339

Browse files
authored
[IDEA] Enforce clean dependency refresh for Gradle Dependencies (#136490) (#136526)
We enforce a full rewrite of module dependencies. We have seen problems with idea classpaths when major dependency updates have been made (e.g. lucene updates). This should avoid keeping stale dependencies on the idea classpath causing trouble for our engineers.
1 parent 27cdf64 commit ead6339

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build-tools-internal/src/main/groovy/elasticsearch.ide.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ import java.nio.file.StandardCopyOption
2121
allprojects {
2222
apply plugin: 'idea'
2323

24+
// We got reports of invalid idea classpaths when major classpath changes (e.g. lucene update)
25+
// has been merged and developers switching back and forth. This should enforce idea
26+
// to not try to be smart.
27+
// This enforces A "complete rewrite" causing all existing content to be discarded,
28+
// thereby losing any changes made directly in the IDE but that should be fine for us.
29+
idea.module.iml {
30+
beforeMerged { module ->
31+
module.dependencies.clear()
32+
}
33+
}
34+
2435
tasks.named('idea').configure {
2536
doFirst { throw new GradleException("Use of the 'idea' task has been deprecated. For details on importing into IntelliJ see CONTRIBUTING.md.") }
2637
}

0 commit comments

Comments
 (0)