This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven.git
commit ae56c9b76e6628a2dabc19ef863eb47218ca21ca Author: Guillaume Nodet <gno...@gmail.com> AuthorDate: Mon Nov 25 08:05:44 2024 +0100 Thrown a more meaningful exception --- .../java/org/apache/maven/lifecycle/internal/concurrent/BuildPlan.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlan.java b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlan.java index 222a1ecd77..7e07c2de28 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlan.java +++ b/impl/maven-core/src/main/java/org/apache/maven/lifecycle/internal/concurrent/BuildPlan.java @@ -25,6 +25,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Optional; import java.util.Set; import java.util.function.Function; @@ -85,7 +86,7 @@ public class BuildPlan { } public BuildStep requiredStep(MavenProject project, String name) { - return step(project, name).get(); + return step(project, name).orElseThrow(() -> new NoSuchElementException("Step " + name + " not found")); } // add a follow-up plan to this one