Skip to content

Commit

Permalink
[MNG-8247] Make exception information clearer when building in parallel
Browse files Browse the repository at this point in the history
Signed-off-by: crazyhzm <crazyhzm@apache.org>
  • Loading branch information
CrazyHZM committed Sep 28, 2024
1 parent 2c6846b commit 68253b8
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ private Clock getClock(Object key) {
return clocks.computeIfAbsent(key, p -> new Clock());
}

private void plan() {
private void plan() throws Exception {
lock.writeLock().lock();
try {
Set<BuildStep> planSteps = plan.allSteps()
Expand All @@ -412,6 +412,12 @@ private void plan() {
MojoDescriptor mojoDescriptor = getMojoDescriptor(project, plugin, goal);
String phase =
execution.getPhase() != null ? execution.getPhase() : mojoDescriptor.getPhase();
if (phase == null) {
throw new LifecyclePhaseNotFoundException(
"The builder requested using id = " + execution.getId()
+ " cannot be found.",
null);
}
String tmpResolvedPhase = plan.aliases().getOrDefault(phase, phase);
String resolvedPhase = tmpResolvedPhase.startsWith(AT)
? tmpResolvedPhase.substring(AT.length())
Expand Down

0 comments on commit 68253b8

Please sign in to comment.