Skip to content

How to generate Checkstyle report for Google Guava project

Roman Ivanov edited this page Aug 8, 2015 · 7 revisions
  1. get sources:
git clone https://github.com/google/guava.git
  1. change pom.xml to add Checkstyle plugin config with overridden version of checkstyle library
    <pluginManagement>
      <plugins>
.......
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.16</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>6.9</version>
            </dependency>
          </dependencies>
		  <configuration>
		    <configLocation>/google_checks.xml</configLocation>
		    <enableFilesSummary>false</enableFilesSummary>
		  </configuration>
        </plugin>
    ........
    </pluginManagement>
   </plugins>

Run:

mvn clean jxr:aggregate checkstyle:checkstyle-aggregate
  1. To make report looks good, use css :
mkdir target/site/css
wget http://checkstyle.sourceforge.net/reports/google-style/guava/css/maven-base.css -O target/site/css/maven-base.css
wget http://checkstyle.sourceforge.net/reports/google-style/guava/css/maven-theme.css  -O target/site/css/maven-theme.css
  1. Deploy to http://checkstyle.sourceforge.net/reports/google-style/guava/
CS_VERSION="6.9"
tar cvfz guava-report-$CS_VERSION.tar.gz target/site/
ssh -t romanivanov,[email protected] create
exit
scp guava-report-$CS_VERSION.tar.gz romanivanov,[email protected]:/home/project-web/checkstyle
ssh romanivanov,[email protected]
cd /home/project-web/checkstyle
tar -xvf guava-report-$CS_VERSION.tar.gz 
rm -rf reports/google-style/guava/*
mv target/site/* reports/google-style/guava/
cd reports/google-style/guava/
ln -s checkstyle-aggregate.html index.html
cd ../../../
rm -rf target/
exit
  1. Recheck that content is updated http://checkstyle.sourceforge.net/reports/google-style/guava/