diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java index bba94f6c7d173..83a702f8a85d7 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java @@ -23,6 +23,7 @@ import org.elasticsearch.gradle.FileSupplier; import org.elasticsearch.gradle.OS; import org.elasticsearch.gradle.Version; +import org.gradle.api.file.DuplicatesStrategy; import org.gradle.api.logging.Logger; import org.gradle.api.logging.Logging; @@ -361,6 +362,9 @@ private void copyExtraConfigFiles() { private void installModules() { if (distribution == Distribution.INTEG_TEST) { modules.forEach(module -> services.copy(spec -> { + // ensure we don't override any existing JARs, since these are hardlinks other clusters might be using those files + spec.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE); + if (module.getName().toLowerCase().endsWith(".zip")) { spec.from(services.zipTree(module)); } else if (module.isDirectory()) {