Skip to content

Commit 6502d26

Browse files
committed
[Build] Declare mirror for eclipse p2 repository (elastic#117732)
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` (cherry picked from commit c35777a) # Conflicts: # build-conventions/src/main/java/org/elasticsearch/gradle/internal/conventions/precommit/FormattingPrecommitPlugin.java
1 parent f403283 commit 6502d26

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import org.gradle.api.Plugin;
1515
import org.gradle.api.Project;
1616

17+
import java.util.Map;
18+
1719
/**
1820
* This plugin configures formatting for Java source using Spotless
1921
* for Gradle. Since the act of formatting existing source can interfere
@@ -66,7 +68,13 @@ public void apply(Project project) {
6668
java.importOrderFile(project.getRootProject().file(importOrderPath));
6769

6870
// Most formatting is done through the Eclipse formatter
69-
java.eclipse().configFile(project.getRootProject().file(formatterConfigPath));
71+
<<<<<<< HEAD
72+
java.eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/"))
73+
.configFile(new File(elasticsearchWorkspace, formatterConfigPath)).configFile(project.getRootProject().file(formatterConfigPath));
74+
=======
75+
java.eclipse().withP2Mirrors(Map.of("https://download.eclipse.org/", "https://mirror.umd.edu/eclipse/"))
76+
.configFile(new File(elasticsearchWorkspace, formatterConfigPath));
77+
>>>>>>> c35777a175f ([Build] Declare mirror for eclipse p2 repository (#117732))
7078

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

0 commit comments

Comments
 (0)