Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1.1
-
None
-
None
Description
Current situation
In 3.1.1, the PR https://github.com/apache/maven-checkstyle-plugin/pull/18 added a try-catch-block to the to-be-removed method call Checker::setClassLoader.
Since users should be encuraged to upgrade and maven-plugin-developers should know that this method should be removed some time, a warning is to be issued if the method call was successful (i.e. when not entering the catch block).
Caveat and drawbacks
- Users will have to update their checkstyle.xml file because of incompatible changes introduced in 8.24.
- Otherwise the warning might confuse users.
- Once the method call to Checker::setClassLoader is removed, checkstyle versions prior to 8.26 (Source: https://checkstyle.org/releasenotes.html#Release_8.26) cannot be used anymore (Source: https://github.com/checkstyle/checkstyle/commit/145160f5e21b80c27dc93a1904fe33b9afd4f212 and https://github.com/checkstyle/checkstyle/issues/3773). But this issue is not about removing this method call any time soon.
=> it will probably work fine for any 8.x version because this method existed for a deprecated check only.
Related issues
- [
MCHECKSTYLE-381|https://issues.apache.org/jira/projects/MCHECKSTYLE/issues/MCHECKSTYLE-381] The mentioned previous commit. - [
MCHECKSTYLE-384|https://issues.apache.org/jira/projects/MCHECKSTYLE/issues/MCHECKSTYLE-384]: Once this maven-checkstyle-plugin updates to checkstyle > 8.24, the default installation for users will break existing installations unless users use this method of downgrading their checkstyle version: https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html. - Also track https://github.com/checkstyle/checkstyle/issues/7190. This will tell when the checkstyle team removes that method.
Documentation
- maven-checkstyle-plugin is compatible with all checkstyle versions by functionality.
- maven-checkstyle-plugin >= 3.1.2 will complain if checkstyle < 8.29 is being used, which is the default (since it requires checkstyle 8.19).
- If we are ever going to remove the method Checker::setClassLoader, this means that earlier versions than checkstyle 8.26 are not supported. They will probably work just fine, but the method call became a 'real' no-op in 8.26. Might be worth documentation.
Attachments
Issue Links
- links to