Wednesday, 19 October 2011

Using Simian with Maven

The Simian documentation is a little brief, so here is how I got Simian integrated into our build.

As we already use Checkstyle, I integrated using the CheckStyle plugin.  Add the following to your Checkstyle xml configuration file, inside the Checker module tag:

<module name="com.harukizaemon.simian.SimianCheck"/>

Then I altered my Checkstyle Maven plugin:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.5</version>
                <dependencies>
                      <dependency>
                        <groupId>com.harukizaemon</groupId>
                        <artifactId>simian</artifactId>
                        <version>2.3.33</version>
                      </dependency>
                </dependencies>
                <configuration>
                    <configLocation>${user.home}/checkstyle.xml</configLocation>
                </configuration>
            </plugin>

Finally I uploaded the Simian jar to our Maven repository.

Simian warnings are now outputted as part of the Checkstyle warnings.

[Note there is a very old Maven 1 Simian plugin kicking around on the internet, but this is unlikely to be of any use to you]

No comments:

Post a Comment