cstamas commented on code in PR #11916:
URL: https://github.com/apache/maven/pull/11916#discussion_r3063668092
##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecyclePluginAnalyzer.java:
##########
@@ -79,7 +88,22 @@ public Set<Plugin>
getPluginsBoundByDefaultToAllLifecycles(String packaging) {
+ Thread.currentThread().getContextClassLoader());
}
- LifecycleMapping lifecycleMappingForPackaging =
lifecycleMappings.get(packaging);
+ Map<String, LifecycleMapping> filtered = new HashMap<>();
+ // filter by visibility (plexus vs sisu diff; "realms" are plexus
thing)
+ // in some tests container is not injected
+ if (this.plexusContainer != null) {
+ for (String name : this.lifecycleMappings.keySet()) {
+ try {
+ filtered.put(name,
plexusContainer.lookup(LifecycleMapping.class, name));
+ } catch (ComponentLookupException e) {
+ // skip it
+ }
Review Comment:
Nope, we cannot; there is a slight semantic difference between (lookup w/
class) vs (lookup w/ roleString and for all hasComponent). Latter returns
_plexus registered beans only_. Hence, as now the core packagings are migrated
to JSR330, hasComponent would return `false`, and similarly, CLEx would be
thrown if we'd do `lookup(LifecycleMapping.class.getName(), name)`.
--
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]