Skip to content

Commit

Permalink
[Build] Declare mirror for eclipse p2 repository (elastic#117732)
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
breskeby committed Nov 29, 2024
1 parent abb4585 commit 8bd4621
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.gradle.api.Project;

import java.io.File;
import java.util.Arrays;
import java.util.Map;

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

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

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

0 comments on commit 8bd4621

Please sign in to comment.