Skip to content

Using Google Java Conventions XML Config causes failure #176

Closed
@schl3sch

Description

@schl3sch

Affected version

3.6.0

Bug description

When I use the google_checks.xml template as config file with the maven-checkstyle-plugin, the mvn checkstyle:checkstyle command fails, while with sun_checks.xml template everything works fine.

pom.xml:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-checkstyle-plugin</artifactId>
    <version>3.6.0</version>
    <configuration>
	  <configLocation>google_checks.xml</configLocation>
	  <outputDirectory>checkstyle</outputDirectory>
    </configuration>
</plugin>

output:

mvn checkstyle:checkstyle 
[INFO] Scanning for projects...
[INFO] 
[INFO] --------< test.project >---------
[INFO] Building  0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-checkstyle-plugin:3.6.0:checkstyle (default-cli) @ test.project ---
[INFO] Rendering content with org.apache.maven.skins:maven-fluido-skin:jar:2.0.0-M9 skin
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.980 s
[INFO] Finished at: 2025-05-13T14:19:00+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:checkstyle (default-cli) on project test.project: An error has occurred in Checkstyle report generation.: Failed during checkstyle configuration: cannot initialize module SuppressWithNearbyTextFilter - Unable to instantiate 'SuppressWithNearbyTextFilter' class, it is also not possible to instantiate it as .SuppressWithNearbyTextFilter, SuppressWithNearbyTextFilterCheck, .SuppressWithNearbyTextFilterCheck. Please recheck that class name is specified as canonical name or read how to configure short name usage https://checkstyle.org/config.html#Packages. Please also recheck that provided ClassLoader to Checker is configured correctly. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions