You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/04/23 20:22:34 UTC

[GitHub] [maven] michael-o commented on a diff in pull request #726: [MNG-7457] Warn about deprecated plugin Mojo

michael-o commented on code in PR #726:
URL: https://github.com/apache/maven/pull/726#discussion_r857031988


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DeprecatedPluginValidator.java:
##########
@@ -112,22 +118,38 @@ private static boolean isValueSet( PlexusConfiguration config,
         return false;
     }
 
-    private static void logDeprecateWarn( Parameter parameter )
+    private void logDeprecateMojo( MojoDescriptor mojoDescriptor )
+    {
+        String message = MessageUtils.buffer()
+            .warning( "Goal '" )
+            .warning( mojoDescriptor.getGoal() )
+            .warning( "' is deprecated: " )
+            .warning( mojoDescriptor.getDeprecated() )
+            .toString();
+
+        LOGGER.warn( message );
+    }
+
+    private static void logDeprecateParameter( Parameter parameter )

Review Comment:
   `logDeprecatedParameter`



##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DeprecatedPluginValidator.java:
##########
@@ -32,7 +33,7 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Print warnings if deprecated params of plugin are used in configuration.
+ * Print warnings if deprecated Mojo or params of plugin are used in configuration.

Review Comment:
   Please make it readable: mojo or parameters



##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DeprecatedPluginValidator.java:
##########
@@ -112,22 +118,38 @@ private static boolean isValueSet( PlexusConfiguration config,
         return false;
     }
 
-    private static void logDeprecateWarn( Parameter parameter )
+    private void logDeprecateMojo( MojoDescriptor mojoDescriptor )

Review Comment:
   `logDeprecatedMojo`



-- 
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-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org