Skip to content

03. Coding conventions

Ilkka Seppälä edited this page Mar 13, 2016 · 7 revisions

The code should be formatted according to Google Java Style Guide.

The coding conventions defined in checkstyle.xml 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>