Skip to content

Commit be23658

Browse files
committed
Avoid clobbering shared testcluster JAR files when installing modules (#42879)
(cherry picked from commit 6da9aa2)
1 parent 78be3dd commit be23658

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

buildSrc/src/main/java/org/elasticsearch/gradle/testclusters/ElasticsearchNode.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.elasticsearch.gradle.FileSupplier;
2424
import org.elasticsearch.gradle.OS;
2525
import org.elasticsearch.gradle.Version;
26+
import org.gradle.api.file.DuplicatesStrategy;
2627
import org.gradle.api.logging.Logger;
2728
import org.gradle.api.logging.Logging;
2829

@@ -361,6 +362,9 @@ private void copyExtraConfigFiles() {
361362
private void installModules() {
362363
if (distribution == Distribution.INTEG_TEST) {
363364
modules.forEach(module -> services.copy(spec -> {
365+
// ensure we don't override any existing JARs, since these are hardlinks other clusters might be using those files
366+
spec.setDuplicatesStrategy(DuplicatesStrategy.EXCLUDE);
367+
364368
if (module.getName().toLowerCase().endsWith(".zip")) {
365369
spec.from(services.zipTree(module));
366370
} else if (module.isDirectory()) {

0 commit comments

Comments
 (0)