You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/06/19 20:36:15 UTC

[maven] branch MNG-7504 created (now 863d75933)

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a change to branch MNG-7504
in repository https://gitbox.apache.org/repos/asf/maven.git


      at 863d75933 [MNG-7504] Don't print warning unsupported reportPlugins for m-site-p

This branch includes the following new commits:

     new 863d75933 [MNG-7504] Don't print warning unsupported reportPlugins for m-site-p

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [MNG-7504] Don't print warning unsupported reportPlugins for m-site-p

Posted by sj...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch MNG-7504
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 863d75933fb3f761f70cf396f0a8a3e76c12b2dc
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Sun Jun 19 22:07:04 2022 +0200

    [MNG-7504] Don't print warning unsupported reportPlugins for m-site-p
---
 .../internal/DefaultMojoExecutionConfigurator.java | 54 ++++++++++++++--------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
index 298562ded..4978bb1df 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultMojoExecutionConfigurator.java
@@ -151,28 +151,42 @@ public class DefaultMojoExecutionConfigurator
 
         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() );
-
-                if ( mojoExecution.getExecutionId() != null )
+        unknownParameters.stream()
+            .filter( parameterName -> isNotReportPluginsForMavenSite( parameterName, mojoExecution ) )
+            .forEach(
+                name ->
                 {
-                    messageBuilder.warning( " (" );
-                    messageBuilder.warning( mojoExecution.getExecutionId() );
-                    messageBuilder.warning( ")" );
-                }
-
-                messageBuilder.warning( "'" );
+                    MessageBuilder messageBuilder = MessageUtils.buffer()
+                        .warning( "Parameter '" )
+                        .warning( name )
+                        .warning( "' is unknown for plugin '" )
+                        .warning( mojoExecution.getArtifactId() ).warning( ":" )
+                        .warning( mojoExecution.getVersion() ).warning( ":" )
+                        .warning( mojoExecution.getGoal() );
+
+                    if ( mojoExecution.getExecutionId() != null )
+                    {
+                        messageBuilder.warning( " (" );
+                        messageBuilder.warning( mojoExecution.getExecutionId() );
+                        messageBuilder.warning( ")" );
+                    }
+
+                    messageBuilder.warning( "'" );
+
+                    logger.warn( messageBuilder.toString() );
+                } );
+    }
 
-                logger.warn( messageBuilder.toString() );
-            } );
+    /**
+     * Method can be removed after {@link org.apache.maven.model.plugin.ReportingConverter} will be removed or disabled
+     *
+     * @return true if parameter is not reportPlugins for m-site-p
+     */
+    private boolean isNotReportPluginsForMavenSite( String parameterName,
+                                                    MojoExecution mojoExecution )
+    {
+        return !( "reportPlugins".equals( parameterName )
+            && "maven-site-plugin".equals( mojoExecution.getArtifactId() ) );
     }
 
     private Stream<String> getParameterNames( Parameter parameter )