michael-o commented on code in PR #741: URL: https://github.com/apache/maven/pull/741#discussion_r882884736
########## maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java: ########## @@ -108,4 +122,75 @@ private PluginExecution findPluginExecution( String executionId, Collection<Plug return null; } + private void checkUnKnownMojoConfigurationParameters( MojoExecution mojoExecution ) + { + if ( mojoExecution.getConfiguration() == null || mojoExecution.getConfiguration().getChildCount() == 0 ) + { + return; + } + + MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); + + // in first step get parameter names of current goal + Set<String> parametersNamesGoal = mojoDescriptor.getParameters().stream() + .flatMap( this::getParameterNames ) + .collect( Collectors.toSet() ); + + Set<String> unknownParameters = getUnknownParameters( mojoExecution, parametersNamesGoal ); + + if ( unknownParameters.isEmpty() ) + { + return; + } + + // second step get parameter names of all plugin goals + Set<String> parametersNamesAll = mojoDescriptor.getPluginDescriptor().getMojos().stream() + .flatMap( m -> m.getParameters().stream() ) + .flatMap( this::getParameterNames ) + .collect( Collectors.toSet() ); Review Comment: I see, makes sense. -- 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