diff --git a/CHANGES.md b/CHANGES.md index 5ec89d7173..0ddf4511b0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,8 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ### Added * `Jvm.Support` now accepts `-SNAPSHOT` versions, treated as the non`-SNAPSHOT`. ([#1583](https://github.com/diffplug/spotless/issues/1583)) +### Fixed +* When P2 download fails, indicate the responsible formatter. ([#1698](https://github.com/diffplug/spotless/issues/1698)) ## [2.38.0] - 2023-04-06 ### Added diff --git a/lib-extra/src/main/java/com/diffplug/spotless/extra/EquoBasedStepBuilder.java b/lib-extra/src/main/java/com/diffplug/spotless/extra/EquoBasedStepBuilder.java index db2e6674db..7f0e181837 100644 --- a/lib-extra/src/main/java/com/diffplug/spotless/extra/EquoBasedStepBuilder.java +++ b/lib-extra/src/main/java/com/diffplug/spotless/extra/EquoBasedStepBuilder.java @@ -16,6 +16,7 @@ package com.diffplug.spotless.extra; import java.io.File; +import java.io.IOException; import java.io.Serializable; import java.util.ArrayList; import java.util.List; @@ -36,6 +37,7 @@ import dev.equo.solstice.p2.P2ClientCache; import dev.equo.solstice.p2.P2Model; import dev.equo.solstice.p2.P2QueryCache; +import dev.equo.solstice.p2.P2QueryResult; /** * Generic Eclipse based formatter step {@link State} builder. @@ -100,7 +102,12 @@ protected void addPlatformRepo(P2Model model, String version) { /** Creates the state of the configuration. */ EquoBasedStepBuilder.State get() throws Exception { - var query = createModelWithMirrors().query(P2ClientCache.PREFER_OFFLINE, P2QueryCache.ALLOW); + P2QueryResult query; + try { + query = createModelWithMirrors().query(P2ClientCache.PREFER_OFFLINE, P2QueryCache.ALLOW); + } catch (Exception x) { + throw new IOException("Failed to load " + formatterName + ": " + x, x); + } var classpath = new ArrayList(); var mavenDeps = new ArrayList(); mavenDeps.add("dev.equo.ide:solstice:1.0.3"); diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index becf2e5ac7..56afb7c34f 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed * Added `@DisableCachingByDefault` to `RegisterDependenciesTask`. +* When P2 download fails, indicate the responsible formatter. ([#1698](https://github.com/diffplug/spotless/issues/1698)) ## [6.18.0] - 2023-04-06 ### Added diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index c00aeda138..06bf3c86bf 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -5,6 +5,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed * `palantir` step now accepts a `style` parameter, which is documentation had already claimed to do. ([#1694](https://github.com/diffplug/spotless/pull/1694)) +* When P2 download fails, indicate the responsible formatter. ([#1698](https://github.com/diffplug/spotless/issues/1698)) ## [2.36.0] - 2023-04-06 ### Added