bmhm commented on a change in pull request #28: [MCHECKSTYLE-387] emit a 
warning when using an old version of checkstyle
URL: 
https://github.com/apache/maven-checkstyle-plugin/pull/28#discussion_r386233314
 
 

 ##########
 File path: 
src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java
 ##########
 @@ -314,6 +314,13 @@ public URLClassLoader run()
         try
         {
             checker.setClassLoader( projectClassLoader );
+            /*
+             * MCHECKSTYLE-387: If the previous method call was successful, 
emit a warning that the user is using
+             * an old version of checkstyle.
+             */
+            getLogger().warn( "Old version of checkstyle detected. Consider 
updating to >= v8.30" );
+            getLogger().warn( "For more information see: "
+                + 
"https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html";
 );
         }
         catch ( NoSuchMethodError ignored )
 
 Review comment:
   @hazendaz 
   I think @romani and I are talking about different things. Also, this issue 
is not the right place to discuss @romani s point. This PR is only to add a 
(maybe useless/needless) warning. But the try-catch-block is already in 
production. So we might want to move this discussion into a new issue?!
   
   About the execution problem romani mentioned:
   Please see 
https://github.com/checkstyle/checkstyle/issues/7190#issuecomment-593259487
   
   When using the `maven-checkstyle-plugin:3.1.1`, you can execute both 
checkstyle(libary) versions up to 8.29 where the `setClassLoader()` method gets 
called, and after 8.29 (I tested 8.31-SNAPSHOT), java  will run into the 
`catch` block as expected.
   
   The issue @romani is facing originates from not using a 
`maven-checkstyle-plugin` version with the try-catch-block, see 
https://github.com/checkstyle/checkstyle/issues/7190#issuecomment-593261410
   
   Let's resolve this conversation with this. If you still encounter issues 
**after updating to `maven-checkstyle-plugin:3.1.1`**, please file a bug at 
apache jira: https://issues.apache.org/jira
   
   @hazendaz Please open another conversation to talk about the idea of this 
PR. I am very open to not integrating it if there are better ways.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to