Skip to content

Commit 258d82f

Browse files
committed
[IDEA] Enforce clean dependency refresh for Gradle Dependencies (elastic#136490)
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 44f1173 commit 258d82f

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
@@ -26,6 +26,17 @@ import groovy.xml.XmlNodePrinter
2626
allprojects {
2727
apply plugin: 'idea'
2828

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

0 commit comments

Comments
 (0)