maven-checkstyle-plugin configuration for non-java-files

78 views
Skip to first unread message

Mike Rumpf

unread,
Jun 2, 2021, 4:18:23 AM6/2/21
to checkstyle

Hi,

I wrote some custom cs rules working on OSGi .MF manifest files. They work fine with in Eclipse.
But I cannot get the MVN-tyho-build to work. It seems that only java-files are checked.

How can I configure non-java files to be checked as well?

At the moment I am trying the following which doesn't work:

Thanks in advance,

Mike


    <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.1.2</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>8.36.1</version>
                        </dependency>
                        <dependency>
                            <groupId>gp.osgi</groupId>
                            <artifactId>gp.osgi.checkstyle.rules</artifactId>
                            <version>0.10.32</version>
                        </dependency>
                        
                    </dependencies>

                    <configuration>
                        <configLocation>releng/jenkins/checkstyle/CheckStyleMaven.xml</configLocation>
                        <suppressionsLocation>releng/jenkins/checkstyle/CheckStyle-suppressions.xml</suppressionsLocation>
                        <consoleOutput>true</consoleOutput>
                        <includeResources>true</includeResources>
                        <linkXRef>false</linkXRef>
                        <resourceIncludes>**\/*.java, **\/*.MF, **\/.xml, **\/.properties</resourceIncludes>
                        <includes>**\/*.java, **\/*.MF, **\/.xml, **\/.properties</includes>
                        <sourceDirectories>
                            <sourceDirectory>${project.basedir}/META-INF</sourceDirectory>
                            <sourceDirectory>${project.basedir}/OSGI-INF</sourceDirectory>
                            <sourceDirectory>${project.basedir}/src</sourceDirectory>
                        </sourceDirectories>
                        <!-- Default value is: ${project.compileSourceRoots}. -->
                        <encoding>UTF-8</encoding>
                        <failsOnError>false</failsOnError>
                    </configuration>
                </plugin>

Mike Rumpf

unread,
Jun 2, 2021, 5:41:38 AM6/2/21
to checkstyle
I found the problem myself. I had an issue with different versions of checkstyle on the classpath.

leann Seitz

unread,
Jun 3, 2021, 9:31:25 PM6/3/21
to Mike Rumpf, checkstyle
Please fix what is wrong.
L.Seitz

--
You received this message because you are subscribed to the Google Groups "checkstyle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to checkstyle+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/checkstyle/d258f608-b0f5-462b-b182-a612e2456dd8n%40googlegroups.com.

Roman Ivanov

unread,
Jun 5, 2021, 10:33:17 AM6/5/21
to checkstyle
Hi Mike,

If your project is open for other to use you can send us PR(whole web site is in git repo of checkstyle library) to reference your project 
at https://checkstyle.org/#Related_Tools_Active_Tools so some other users might find your extension valuable.

thanks,
Roman Ivanov
Reply all
Reply to author
Forward
0 new messages