this question seems pretty common, but I really couldn't get it to work from existing answers. I have a simple maven project without any complicated configuration for deployment, etc. And you want to create a Maven CheckStyle report when you get to the "mvn site".
My pom.xml looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>mygroup</groupId> <artifactId>TestProjekt</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>TestProjekt</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>2.6</version> <configuration> <configLocation>mychecks.xml</configLocation> </configuration> </plugin> </plugins> </reporting> </project>
I have mychecks.xml in the project root directory (next to pom.xml). The problem is that when I am on the "mvn site" nothing happens at all (except for maven, writing a few lines about BUILD SUCCESS). I read that I need to place mychecks.xml in a directory called "resources" or something like that, but that didn't work either.
Does anyone have a clue what to do so that the "mvn site" generates a checkstyle rport (and where to find it)? Any help was appreciated.
source share