Skip to content

Commit

Permalink
Fix NPE ProjectExecutionManager.resolvePhase
Browse files Browse the repository at this point in the history
defaultLifecycles.get(phase) can return null as phase is the value provided by users on the command line.
E.g. direct mojo execution.
  • Loading branch information
romain-grecourt committed Jul 26, 2024
1 parent 8a4a1c9 commit 9fb3173
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ private List<MojoExecution> resolvePhase(MavenProject project, String phase) {
try {
lock.lock();
Lifecycle lifecycle = defaultLifecycles.get(phase);
if (lifecycle == null) {
return List.of();
}
LifecycleMappingDelegate lifecycleDelegate = null;
if (Arrays.binarySearch(DefaultLifecycles.STANDARD_LIFECYCLES, lifecycle.getId()) < 0) {
lifecycleDelegate = lifecycleDelegates.get(lifecycle.getId());
Expand Down

0 comments on commit 9fb3173

Please sign in to comment.