-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Description
Implement Checkstyle for consistent code style and quality enforcement.
Add Maven plugin configuration:
Add Checkstyle to the build process so it runs automatically when we build/test the project.
Example:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven.checkstyle.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<includeResources>false</includeResources>
<includeTestResources>false</includeTestResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<configLocation>
https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle_checks.xml
</configLocation>
<propertiesLocation>config/checkstyle.properties</propertiesLocation>
<failOnViolation>true</failOnViolation>
<logViolationsToConsole>true</logViolationsToConsole>
<maxAllowedViolations>0</maxAllowedViolations>
<violationSeverity>error</violationSeverity>
<outputFileFormat>xml</outputFileFormat>
<outputFile>
${project.build.directory}/checkstyle/checkstyle-report.xml
</outputFile>
</configuration>
</execution>
</executions>
</plugin>Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done