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/07/11 15:40:38 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #765: Experiment: warn on ancient plugin

gnodet commented on code in PR #765:
URL: https://github.com/apache/maven/pull/765#discussion_r918084082


##########
maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java:
##########
@@ -419,6 +421,32 @@ private void createPluginRealm( PluginDescriptor pluginDescriptor, MavenSession
 
         pluginDescriptor.setClassRealm( pluginRealm );
         pluginDescriptor.setArtifacts( pluginArtifacts );
+
+        try
+        {
+            GenericVersionScheme versionScheme = new GenericVersionScheme();
+            Version minimumVersion = versionScheme.parseVersion( "3.1.0" );
+            for ( Artifact artifact : pluginArtifacts )
+            {
+                if ( "org.apache.maven".equals( artifact.getGroupId() ) && "maven-plugin-api".equals(
+                        artifact.getArtifactId() ) )
+                {
+                    Version mavenPluginApiVersion = versionScheme.parseVersion( artifact.getVersion() );
+                    if ( minimumVersion.compareTo( mavenPluginApiVersion ) > 0 )
+                    {
+                        logger.warn( "" );
+                        logger.warn( "Plugin " + plugin.getId()
+                                + " is old, please update to plugin supporting Maven 3.1+" );

Review Comment:
   I'd suggest something like:
   ```The plugin uses an old version of the maven api, please update the plugin to support Maven 3.1+```



-- 
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