I am trying to get checkstyle to use a customised format contained in a file called checkstyle-src.xml

i have found however when i configure the checkstyle property called 'propertiesFile' this has no effect - i still get the default checks.

if i specify a file that does not exist i get an error (which is fair enough) but any edits i make to that file have no effect on the execution of checkstyle

this has come up because i am running checkstyle with one fomrat on the main code base and a more relaxed checkstyle on the test source

but no matter what i set the propertiesFile to, if it's a valid file then i get the default checks all the time.

am i setting the right property?

the build section of my pom.xm looks like this:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.4</source>
                <target>1.4</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <executions>
                <execution>
                    <id>check-main-src</id>
                    <phase>process-resources</phase>
                   <configuration>
                        <propertiesFile>checkstyle-src.xml</propertiesFile>
                        <failsOnError>true</failsOnError>
                    </configuration>
                    <goals>
                        <goal>checkstyle</goal>
                     </goals>
                 </execution>
                <execution>
                    <id>check-test-src</id>
                    <phase>process-test-resources</phase>
                   <configuration>
                        <propertiesFile>checkstyle-test.xml</propertiesFile>
                        <failsOnError>true</failsOnError>
                        <sourceDirectory>src/test</sourceDirectory>
                    </configuration>
                    <goals>
                        <goal>checkstyle</goal>
                     </goals>
                 </execution>
             </executions>
        </plugin>
    </plugins>
</build>

Kind regards,
Dave Sag




 

Reply via email to