Skip to content

03. Coding conventions

Ilkka Seppälä edited this page Dec 23, 2015 · 8 revisions

Format the code according to Google Java Style Guide

The coding conventions are automatically checked with Maven Checkstyle plugin and the build fails if the conventions are not followed.

<!--checkstyle plug-in. checking against googles styles 
see config at checkstyle.xml-->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-checkstyle-plugin</artifactId>
  <version>2.15</version>
  <executions>
    <execution>
      <id>validate</id>
      <goals>
        <goal>check</goal>
      </goals>
      <phase>validate</phase>
      <configuration>
        <configLocation>checkstyle.xml</configLocation>
        <encoding>UTF-8</encoding>
        <consoleOutput>true</consoleOutput>
        <failsOnError>true</failsOnError>
      </configuration>
    </execution>
  </executions>
</plugin>