I have gone a little further but still no succes.
I found a configuration property but when i set this to true the reporting
fails all together with an exception
this is the property:
                       <failsOnError>true</failsOnError>

This is my configuration
   <build>
       <plugins>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-checkstyle-plugin</artifactId>
               <executions>
                   <execution>
                       <id>basic styles</id>
                       <phase>compile</phase>
                       <configuration>
                       <failsOnError>true</failsOnError>
                           <configLocation>
                               styles.xml
                           </configLocation>
                           <suppressionsLocation>
                               suppressions.xml
                           </suppressionsLocation>

                       </configuration>
                       <goals>
                           <goal>checkstyle</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>
       </plugins>
   </build>

the exception is this:
[ERROR] project-execute : org.dji:maven_build:jar:0.0.1 (  task-segment:
[package] )
Diagnosis: An error has occurred in Checkstyle report generation.
FATAL ERROR: Error executing Maven for a project
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Checkstyle report generation.
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:559)
   at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle
(DefaultLifecycleExecutor.java:475)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:454)
   at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures
(DefaultLifecycleExecutor.java:306)
   at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:140)
   at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java
:441)
   at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java
:382)
   at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error has
occurred in Checkstyle report generation.
   at org.apache.maven.reporting.AbstractMavenReport.execute(
AbstractMavenReport.java:79)
   at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:412)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:534)
   ... 8 more
Caused by: org.apache.maven.reporting.MavenReportException: There are 1
checkstyle errors.
   at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle
(CheckstyleReport.java:754)
   at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(
CheckstyleReport.java:484)
   at org.apache.maven.reporting.AbstractMavenReport.generate(
AbstractMavenReport.java:98)
   at org.apache.maven.reporting.AbstractMavenReport.execute(
AbstractMavenReport.java:73)
   ... 10 more


On 10/9/06, Rolf Strijdhorst <[EMAIL PROTECTED]> wrote:

Hi all,

I was wondering is it possible to let the checkstyle plugin control the
build process like the pmd plugin can do?
For example right now we are using eclipse to manage our build and the
checkstyle plugin (eclipse-cs) prevends the workspace from building on
certain criteria.

I've tried to do the same using a maven build but I can't work it out.

thanx
Rolf

Reply via email to