maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bilisan <vaskoangele...@gmail.com>
Subject Maven with checkstyle to generate reports
Date Mon, 15 Nov 2010 19:41:22 GMT

Hi all,

I have a little problem with configuring maven with checkstyle to generate
reports.
This is the pom of the project which will be added to some CIS (dont know
for sure will it be cruise or hadson or bamboo...)

<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>TestingCheckStyle</groupId>
  <artifactId>TestingCheckStyle</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>TestingCheckStyle</name>
  <description>TestingCheckStyle</description>
  <dependencies>
  	<dependency>
  		<groupId>maven</groupId>
  		<artifactId>maven-checkstyle-plugin</artifactId>
  		<version>2.5</version>
  	</dependency>
  </dependencies>
  <build>
     <plugins>
         <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-checkstyle-plugin</artifactId>
             <version>2.5</version>
             <executions>
                 <execution>
                     <goals>
                         <goal>checkstyle</goal>
                         <goal>check</goal>
                     </goals>
                     <phase>package</phase>
                     <configuration>
                    
<configLocation>${build}\Checkstyle.xml</configLocation>
                     	<sourceDirectory>${build}\src</sourceDirectory>
                     	<outputDirectory>${build}\reports\</outputDirectory>
                     	<failOnViolation>true</failOnViolation>
                        <failsOnError>true</failsOnError>
                     </configuration>
                 </execution>
             </executions>
         </plugin>
     </plugins>

 		 
  </build>
    <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.5</version>
        <configuration>
        <configLocation>${build}\Checkstyle.xml</configLocation>
		<outputDirectory>${build}\reports\</outputDirectory>
          <failOnViolation>true</failOnViolation>
         <failsOnError>true</failsOnError>
        </configuration>
      </plugin>      
    </plugins>
  </reporting>
  
</project>

The problem which i am experiencing is that i have a custom checkstyle
configuration , which controls the coding standards and i would like to fail
the build if any type of checkstyle error has been found while cross
checking it with the "checkstyle.xml". Now if the code of the project
contains any type of error the build will fail since i have setted the
failOnViolation/Error on true value. The xmls of the plug in are generated
properly under target window, but i cant get the html report generated when
there are errors.
Even when i run the maven with mvn site. Can you please tell me how to get
the html report generated even if the build fails because of the checkstyle?


-- 
View this message in context: http://maven.40175.n5.nabble.com/Maven-with-checkstyle-to-generate-reports-tp3266302p3266302.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message