Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run maven checkstyle plugin on incremental code only

I want to add auto code review feature to our application. Currently we use maven to do builds. I came across maven checkstyle plugin but want this to run it only on incremental code that gets added and not on older one. Can i achieve this using this plugin? If yes then please provide pointers on how to do it?

like image 310
Pushkin Avatar asked Dec 24 '15 13:12

Pushkin


Video Answer


1 Answers

Checkstyle plugin has no idea what files are modified or new. The only way of incrementally adding checkstyle to a project would be using includes configuration, manually putting new files/packages etc. It's a comma separated list of patterns.

        <executions>
            <execution>
                <id>checkstyle-verify</id>
                <phase>verify</phase>
                <goals>
                    <goal>check</goal>
                </goals>
                <configuration>
                    <includes>NewClass.java,AnotherClass.java</includes>
                </configuration>
            </execution>
        </executions>
like image 155
Oleg Mikheev Avatar answered Oct 16 '22 18:10

Oleg Mikheev