Does maven-checkstyle-plugin checks files only within the /src directory

684 views Asked by At

I wonder if the maven-checkstyle-plugin only check files within the /src directories of a project or multi-module project.

I do have a maven project where I don't have /src directories but loads of *.yaml, *.wsdl, *.json and *.xsd files and do not know if they are gonna checked with this plugin as well.

1

There are 1 answers

0
Benjamin Marwell On

Yes, you can activate more checks for more filetypes in more locations. However...

You are probably using the check goal of the maven-checkstyle-plugin. As you can see, the default resource includes is only set to **/*.properties. Change it to anything you like.


To answer your seconds question, where checkstyle will look for sources and resources, there's an option for this in the same page:

<sourceDirectories> List    2.13    Specifies the location of the source directories to be used for Checkstyle. Default value is ${project.compileSourceRoots}.

However, the standard checks included in checkstyle do not include a lot of checks for files other than .java or .properties files. You might want to take a look at other plugins, like the spotless-maven-plugin's prettier configuration.