Here's two "best practice" approaches generally suggested to solve
this problem on this list:
1. Put the checkstyle.xml file in a location that can be accessed
using HTTP. This may be a particular file on a Webserver or just
reference a file in a Subversion repository.
2. Create a new Maven package to contain these kinds of configuration
files etc across your organization/projects. Package the
checkstyle.xml file in a Jar, deploy it to your Maven repo, and then
add a dependency to this new config jar to the checkstyle plugin
declaration.
Wayne
On 6/21/07, nitinaggarwal <[EMAIL PROTECTED]> wrote:
Hi
I am facing a similiar issue in my project.
But additionally i want the a checkstyle file FC-CheckStyle.xml
customized to my project be invoked in order to find out if there are
checkstyle errors .
how do i do that?
Additionally can some one tell me how can i refer to this file as this is
located in my root directory
and i want to invoke the file in a directory fc
to be more clear i will provide a brief about my project.
FC-4.0 Source-->application-->fc (my pom is here)
-->er (and here)
-->portal
--> components-->pom
--> pom
Can some one suggest me how to perform this checkstyle validation.
would you suggest me the validation to be at the top level or at every level
as i am having a multli project build.
but the issue with this approach is that all the developers would have to
build the entire project rather than a sub project for finding out check
style errors.
any comments how we can extend something from the top level pom.
Nitin
[EMAIL PROTECTED]
Guillaume Boucherie wrote:
>
> try something like this.
>
> <build>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins<groupId>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>check</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
>
> by default the check goal is link to verify phase
>
> CletteBou
>
>
> 2007/6/21, Andrew Moores <[EMAIL PROTECTED]>:
>>
>> Hello
>>
>> I want to make my build fail if there are any checkstyle errors in my
>> code. I have added the following to my pom:
>>
>> <build>
>> <plugins>
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-checkstyle-plugin</artifactId>
>> <configuration>
>> <failOnViolation>true</failOnViolation>
>> </configuration>
>> </plugin>
>> </plugins>
>> </build>
>>
>> When I execute mvn checkstyle:check my build fails when I have a
>> checkstyle error.
>>
>> When I execute mvn install the build does not fail. Reading the plugin
>> pages I expected my build to fail for the intall goal as well, what else
>> do
>> I need to add to the POM to make the build fail?
>>
>> I am running Maven 2.0.5.
>>
>> Thanks
>> Andrew
>>
>
>
--
View this message in context:
http://www.nabble.com/How-can-the-checkstyle-plugin-be-configured-to-fail-the-build--tf3959401s177.html#a11245727
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]