コマンドを実行すると、次のエラーが表示されますmvn checkstyle:checkstyle
。
An error has occurred in Checkstyle report generation.
...
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate GenericIllegalRegexp
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:178)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:170)
at org.apache.maven.plugin.checkstyle.AbstractCheckstyleReport.executeReport(AbstractCheckstyleReport.java:259)
... 24 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate GenericIllegalRegexp
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:155)
at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:161)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:184)
at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:157)
... 27 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate GenericIllegalRegexpCheck
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
... 30 more
エラーは、古いバージョンの checkstyle で作成されたルールに関係していると思われます。
pom.xml 内の checkstyle プラグイン構成は次のとおりです。
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
<headerLocation>LICENSE.txt</headerLocation>
</configuration>
</plugin>
...
ルールを移行して checkstyle 5.5 互換にする方法またはツールはありますか? (checkstyleドキュメンテーションに基づくルールごとの概要ルール以外)