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_r386209489
##########
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:
> I think this is a bad way to check this.
The idea was not only to check the version, but rather to keep compatibility
with old checkstyle versions which do need this method call.
> Maybe a better conversation would be if maven should even be the owners of
this plugin to start with.
The checkstyle (library) team said they do not have enough resources to file
the PR themselves iirc. Also, the mentioned berthed was never deprecated
because of this.
> Overall does this PR itself help,
I was only suggesting this because the library did not bother to keep any
semantic versioning. Removing a method is over thing in the same major version,
but also the checks from the checkstyle.xml file a user will configure differs.
Users cannot just switch versions, because the library will just hard fail.
My previous commit tried to make the migration a little more graceful. I am
sorry this did not work as intended. But this also means that all reviewers did
not foresee a problem.
----------------------------------------------------------------
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