You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kaloyan Enimanev (JIRA)" <ji...@codehaus.org> on 2008/10/14 14:17:51 UTC
[jira] Created: (MCHECKSTYLE-104) CheckstyleViolationCheckMojo:
More flexible checkstyle:check-inflicted build failures
CheckstyleViolationCheckMojo: More flexible checkstyle:check-inflicted build failures
-------------------------------------------------------------------------------------
Key: MCHECKSTYLE-104
URL: http://jira.codehaus.org/browse/MCHECKSTYLE-104
Project: Maven 2.x Checkstyle Plugin
Issue Type: New Feature
Affects Versions: 2.2
Reporter: Kaloyan Enimanev
Attachments: CheckstyleViolationCheckMojo.java
Hey guys,
first of all let me thank you for the wonderful job that you all do. Our company's build process has rocketed a century forward after we replaced Ant with Maven.
We're currently trying to migrate from Maven1 to Maven2. We have a Jelly goal in our old M1 build that does similar job to "checkstyle:check" in M2, but it verifies that a project does not have more than {{X}} Checkstyle Errors *and* {{Y}} Checkstyle Warnings. That was not entirely possible to configure with M2, where one can choose to fail the build on more than 0 Errors *or* Warnings, where 0 is not a configurable value in contrast with {{X}} and {{Y}}.
I have scribbled several changes in
{{/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java}}
where I basically replaced the parameter {{violationSeverity}} with 3 new parameters ({{maxErrors}}, {{maxWarnings}}, {{maxInfos}}) allowing the user a more flexible configuration of checkstyle-inflicted build failures.
Example :
The configuration
{code:xml}
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<failsOnError>true</failsOnError>
<maxErrors>0</maxErrors>
<maxWarnings>100</maxWarnings>
.....
</configuration>
......
{code}
will fail the build of a project that has more than 0 Checkstyle Errors or more than 100 Checkstyle Warnings.
If you find such the feature useful and want to include it in some of the next releases of {{maven-checkstyle-plugin}} I will be happy to do the additional Documentation/Test Cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MCHECKSTYLE-104) CheckstyleViolationCheckMojo:
More flexible checkstyle:check-inflicted build failures
Posted by "redfish4ktc (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MCHECKSTYLE-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=183790#action_183790 ]
redfish4ktc commented on MCHECKSTYLE-104:
-----------------------------------------
Hi,
The default value for {{maxErrors, maxWarnings, maxInfos}} should be 0 to match with the default value of [maxAllowedViolations|http://maven.apache.org/plugins/maven-checkstyle-plugin/check-mojo.html#maxAllowedViolations] introduced by MCHECKSTYLE-113.
In the attached code, the values are {{Integer.MAX_VALUE}}
> CheckstyleViolationCheckMojo: More flexible checkstyle:check-inflicted build failures
> -------------------------------------------------------------------------------------
>
> Key: MCHECKSTYLE-104
> URL: http://jira.codehaus.org/browse/MCHECKSTYLE-104
> Project: Maven 2.x Checkstyle Plugin
> Issue Type: New Feature
> Affects Versions: 2.2
> Reporter: Kaloyan Enimanev
> Attachments: CheckstyleViolationCheckMojo.java
>
>
> Hey guys,
> first of all let me thank you for the wonderful job that you all do. Our company's build process has rocketed a century forward after we replaced Ant with Maven.
> We're currently trying to migrate from Maven1 to Maven2. We have a Jelly goal in our old M1 build that does similar job to "checkstyle:check" in M2, but it verifies that a project does not have more than {{X}} Checkstyle Errors *and* {{Y}} Checkstyle Warnings. That was not entirely possible to configure with M2, where one can choose to fail the build on more than 0 Errors *or* Warnings, where 0 is not a configurable value in contrast with {{X}} and {{Y}}.
> I have scribbled several changes in
> {{/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/CheckstyleViolationCheckMojo.java}}
> where I basically replaced the parameter {{violationSeverity}} with 3 new parameters ({{maxErrors}}, {{maxWarnings}}, {{maxInfos}}) allowing the user a more flexible configuration of checkstyle-inflicted build failures.
> Example :
> The configuration
> {code:xml}
> <plugin>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <configuration>
> <failsOnError>true</failsOnError>
> <maxErrors>0</maxErrors>
> <maxWarnings>100</maxWarnings>
> .....
> </configuration>
> ......
> {code}
> will fail the build of a project that has more than 0 Checkstyle Errors or more than 100 Checkstyle Warnings.
> If you find such the feature useful and want to include it in some of the next releases of {{maven-checkstyle-plugin}} I will be happy to do the additional Documentation/Test Cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira