slawekjaranowski commented on code in PR #741: URL: https://github.com/apache/maven/pull/741#discussion_r882886798
########## 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() ); + + unknownParameters = getUnknownParameters( mojoExecution, parametersNamesAll ); + + unknownParameters.forEach( + name -> + { + MessageBuilder messageBuilder = MessageUtils.buffer() + .warning( "Parameter '" ) + .warning( name ) + .warning( "' is unknown for plugin: '" ) + .warning( mojoExecution.getArtifactId() ).warning( ":" ) + .warning( mojoExecution.getVersion() ).warning( ":" ) + .warning( mojoExecution.getGoal() ); Review Comment: dropped -- 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