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/12 18:53:02 UTC

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

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


##########
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:
   Current message (on maven 3.9.x branch), modified to write out at end:
   ```
   [INFO] ------------------------------------------------------------------------
   [INFO] Reactor Summary for Apache Maven 3.9.0-SNAPSHOT:
   [INFO] 
   [INFO] Apache Maven ....................................... SUCCESS [  2.175 s]
   [INFO] Maven Model ........................................ SUCCESS [  2.480 s]
   [INFO] Maven Artifact ..................................... SUCCESS [  0.698 s]
   [INFO] Maven Plugin API ................................... SUCCESS [  0.516 s]
   [INFO] Maven Builder Support .............................. SUCCESS [  0.207 s]
   [INFO] Maven Model Builder ................................ SUCCESS [  1.447 s]
   [INFO] Maven Settings ..................................... SUCCESS [  0.223 s]
   [INFO] Maven Settings Builder ............................. SUCCESS [  0.321 s]
   [INFO] Maven Repository Metadata Model .................... SUCCESS [  0.199 s]
   [INFO] Maven Artifact Resolver Provider ................... SUCCESS [  0.860 s]
   [INFO] Maven Core ......................................... SUCCESS [  3.458 s]
   [INFO] Maven SLF4J Simple Provider ........................ SUCCESS [  0.431 s]
   [INFO] Maven Embedder ..................................... SUCCESS [  0.845 s]
   [INFO] Maven Compat ....................................... SUCCESS [  1.557 s]
   [INFO] Apache Maven Distribution .......................... SUCCESS [  3.164 s]
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  18.744 s
   [INFO] Finished at: 2022-07-12T19:49:02+02:00
   [INFO] ------------------------------------------------------------------------
   [WARNING] Used pre-3.1 Maven plugins in session:
   [WARNING]  * org.apache.maven.plugins:maven-assembly-plugin:3.3.0
   [WARNING]  * org.apache.maven.plugins:maven-checkstyle-plugin:3.0.0
   [WARNING]  * org.apache.maven.plugins:maven-failsafe-plugin:2.22.2
   [WARNING]  * org.apache.maven.plugins:maven-install-plugin:2.5.2
   [WARNING]  * org.apache.maven.plugins:maven-remote-resources-plugin:1.7.0
   [WARNING]  * org.apache.maven.plugins:maven-surefire-plugin:2.22.2
   [WARNING]  * org.apache.rat:apache-rat-plugin:0.13
   [WARNING]  * org.codehaus.mojo:build-helper-maven-plugin:1.12
   [WARNING]  * org.codehaus.mojo:buildnumber-maven-plugin:1.4
   [WARNING]  * org.codehaus.plexus:plexus-component-metadata:2.1.0
   [WARNING]  * org.eclipse.sisu:sisu-maven-plugin:0.3.5
   [WARNING] 
   [WARNING] Total of 11
   [WARNING] Please update to newer versions of these plugins.
   [WARNING] 
   ```



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