slawekjaranowski commented on code in PR #11908:
URL: https://github.com/apache/maven/pull/11908#discussion_r3075338914
##########
maven-core/src/main/java/org/apache/maven/plugin/prefix/internal/DefaultPluginPrefixResolver.java:
##########
@@ -132,7 +138,30 @@ public PluginPrefixResult resolve(PluginPrefixRequest
request) throws NoPluginFo
return result;
}
- private PluginPrefixResult resolveFromProject(PluginPrefixRequest request,
List<Plugin> plugins) {
+ private PluginPrefixResult resolveFromProject(
+ PluginPrefixRequest request, List<Plugin> plugins, List<Plugin>
pluginMgmt) {
+ if (plugins.isEmpty() && pluginMgmt.isEmpty()) {
+ return null;
+ }
+ PluginPrefixResult result = null;
+ // try optimistically; first if A contains prefix?
+ Set<Plugin> candidates = new LinkedHashSet<>();
+ Stream.concat(plugins.stream(), pluginMgmt.stream())
+ .filter(p -> p.getArtifactId().contains(request.getPrefix()))
+ .forEach(candidates::add);
+ if (!candidates.isEmpty()) {
+ result = doResolveFromProject(request, candidates);
+ }
+ // if no luck; try the rest
Review Comment:
maybe here we can try to resolve from repo to avoid download all plugins
from project .... download meta data will be cheaper
--
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]