michael-o commented on code in PR #639:
URL: https://github.com/apache/maven/pull/639#discussion_r954621955
##########
maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java:
##########
@@ -139,13 +138,34 @@ public List<Lifecycle> getLifeCycles()
}
};
+ Map<String, Lifecycle> lifecyclesMap = lookupLifecycleMap();
+
// ensure canonical order of standard lifecycles
return lifecyclesMap.values().stream()
.peek( l -> Objects.requireNonNull( l.getId(),
"A lifecycle must have an id." ) )
.sorted( Comparator.comparing(
Lifecycle::getId, comparator ) )
.collect( Collectors.toList() );
}
+ private Map<String, Lifecycle> lookupLifecycleMap()
Review Comment:
lifecycles
##########
maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycles.java:
##########
@@ -139,13 +138,34 @@ public List<Lifecycle> getLifeCycles()
}
};
+ Map<String, Lifecycle> lifecyclesMap = lookupLifecycleMap();
+
// ensure canonical order of standard lifecycles
return lifecyclesMap.values().stream()
.peek( l -> Objects.requireNonNull( l.getId(),
"A lifecycle must have an id." ) )
.sorted( Comparator.comparing(
Lifecycle::getId, comparator ) )
.collect( Collectors.toList() );
}
+ private Map<String, Lifecycle> lookupLifecycleMap()
+ {
+ // This code is here to ensure maven-compat's EmptyLifecycleExecutor
keeps on working.
+ if ( plexusContainer == null )
Review Comment:
Add a TODO that this needs to go when compat is gone, no?
##########
maven-core/src/test/java/org/apache/maven/lifecycle/internal/LifecycleExecutionPlanCalculatorTest.java:
##########
@@ -63,6 +64,7 @@ public void testCalculateExecutionPlanWithGoalTasks()
// Maybe also make one with LifeCycleTasks
public static LifecycleExecutionPlanCalculator
createExecutionPlaceCalculator( MojoDescriptorCreator mojoDescriptorCreator )
+ throws ComponentLookupException
Review Comment:
Who throws this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]