Skip to content

Commit 91a04f2

Browse files
authored
[IDEA] Enforce clean dependency refresh for Gradle Dependencies (#136490) (#136522)
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 595814e commit 91a04f2

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
@@ -22,6 +22,17 @@ import groovy.xml.XmlNodePrinter
2222
allprojects {
2323
apply plugin: 'idea'
2424

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

0 commit comments

Comments
 (0)