michael-o commented on code in PR #863: URL: https://github.com/apache/maven/pull/863#discussion_r1017653958
########## maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java: ########## @@ -313,6 +317,28 @@ else if ( !MAVEN_RESOLVER_TRANSPORT_AUTO.equals( transport ) ) return session; } + private Map<?, ?> getConfigFromRequestProfiles( MavenExecutionRequest request ) + { + + HashSet<String> activeProfileId = new HashSet<>( request.getProfileActivation().getRequiredActiveProfileIds() ); + activeProfileId.addAll( request.getProfileActivation().getOptionalActiveProfileIds() ); + + return request.getProfiles().stream() + .filter( profile -> activeProfileId.contains( profile.getId() ) ) + .map( ModelBase::getProperties ) + .flatMap( properties -> properties.entrySet().stream() ) + .filter( entry -> isPropertyForResolver( entry.getKey().toString() ) ) + .collect( + Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue, ( k1, k2 ) -> k2 ) ); + } + + private boolean isPropertyForResolver( String propertyName ) + { + return propertyName != null + && ( propertyName.startsWith( "maven.resolver." ) || propertyName.startsWith( "aether." ) ); + } Review Comment: @cstamas WDYT? I think the filter is not required here. -- 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: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org