Skip to content

Commit b127a58

Browse files
authored
[Build] Declare mirror for eclipse p2 repository (#117732) (#117735)
The spotlight plugin directly resolves dependencies from p2 which causes `java.io.IOException: Failed to load eclipse jdt formatter` issues if that repo is not accessible. This is a workaround for the eclipse p2 default repository being down resulting in all our ci jobs to fail. The artifacts in question we wanna cache live in `~/.m2/repository`
1 parent abb4585 commit b127a58

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import org.gradle.api.Project;
1818

1919
import java.io.File;
20+
import java.util.Arrays;
21+
import java.util.Map;
2022

2123
/**
2224
* This plugin configures formatting for Java source using Spotless
@@ -64,7 +66,8 @@ public void apply(Project project) {
6466
java.importOrderFile(new File(elasticsearchWorkspace, importOrderPath));
6567

6668
// Most formatting is done through the Eclipse formatter
67-
java.eclipse().configFile(new File(elasticsearchWorkspace, formatterConfigPath));
69+
java.eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/"))
70+
.configFile(new File(elasticsearchWorkspace, formatterConfigPath));
6871

6972
// Ensure blank lines are actually empty. Since formatters are applied in
7073
// order, apply this one last, otherwise non-empty blank lines can creep

0 commit comments

Comments
 (0)