Reputation: 383
We are currently migrating our Eclipse RCP application on a Maven build with Tycho. Everythings runs fine, so we wanted to introduce the Maven checkstyle plugin. The structure looks as following:
parent
- pom.xml
child1
- pom.xml
child2
- pom.xml
Every child is configured as module from the parent project (and vice versa). We configured the maven-checkstyle-plugin like this:
<build>
...
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0</version>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
</plugin>
</reportPlugins>
</configuration>
</plugin>
</plugins>
</build>
Starting mvn clean install site from the child1 project does create the checkstyle-result.xml but this file is empty.
Any hints what's wrong here?
Upvotes: 2
Views: 1353
Reputation: 363
I would like to point out that your approach of configuring reports in the plugin section is deprecated in maven 3.3.
(from https://maven.apache.org/plugins/maven-site-plugin/maven-3.html)
As a consequence, with maven-site-plugin 3.3, the configuration has simply been removed (more precisely marked private/internal), since it should not be used directly. This documentation has been kept public only to help people who used it in previous versions understand why they need to migrate back to classic configuration.
In addition it is discouraged to use this in any maven version, the recommended way is (again) using the section (but that may change again).
Upvotes: 0
Reputation: 41
this: http://larsmartinle.wordpress.com/2011/01/22/getting-checkstyle-pmd-an-other-plugins-to-work-with-maven/ might help you
add the correct source-location (instead of maven default "src/main/java")
..
<build>
<sourceDirectory>src</sourceDirectory>
..
Upvotes: 3