Skip to content

Commit da63175

Browse files
authored
Improve BWC distribution mismatch error message (#88911) (#89514)
1 parent f942bad commit da63175

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.gradle.language.base.plugins.LifecycleBasePlugin;
2525

2626
import java.io.File;
27+
import java.nio.file.Path;
2728
import java.util.ArrayList;
2829
import java.util.List;
2930
import java.util.Locale;
@@ -251,9 +252,10 @@ static void createBuildBwcTask(
251252
@Override
252253
public void execute(Task task) {
253254
if (expectedOutputFile.exists() == false) {
254-
throw new InvalidUserDataException(
255-
"Building " + bwcVersion.get() + " didn't generate expected artifact " + expectedOutputFile
256-
);
255+
Path relativeOutputPath = project.getRootDir().toPath().relativize(expectedOutputFile.toPath());
256+
final String message = "Building %s didn't generate expected artifact [%s]. The working branch may be "
257+
+ "out-of-date - try merging in the latest upstream changes to the branch.";
258+
throw new InvalidUserDataException(message.formatted(bwcVersion.get(), relativeOutputPath));
257259
}
258260
}
259261
});

0 commit comments

Comments
 (0)