[ 
https://jira.codehaus.org/browse/MFINDBUGS-118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=290432#comment-290432
 ] 

Krzysztof Krason commented on MFINDBUGS-118:
--------------------------------------------

I think that this bug is not about history (for which sonar is the best tool) 
but for basic information about the findings on the console. Just like it 
exists in maven plugins for checkstyle, and PMD.
For me this is the basic functionality.
Right now checking for the bugs takes two steps until one sees which file and 
line was the cause of the bug.
Please look how it is done in checkstyle plugin, the information which 
file/line has the voliation is printed during the maven build.

For those who find this annoying here is a workaround to put in pom.xml:
{code:xml}
                    <plugin>
                        <groupId>org.codehaus.gmaven</groupId>
                        <artifactId>gmaven-plugin</artifactId>
                        <version>1.3</version>
                        <executions>
                            <execution>
                                <id>findbugs-report</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>execute</goal>
                                </goals>
                                <configuration>
                                    <properties>
                                        
<xml>${project.build.directory}/findbugsXml.xml</xml>
                                        <failOnError>true</failOnError>
                                    </properties>
                                    <source>
                                        <![CDATA[
                                        def file = new 
File(project.properties['xml'])
                                        if (!file.exists()) {
                                            log.info('No XML report, nothing to 
parse')
                                            return
                                        }
                                        def xml = new XmlParser().parse(file)
                                        def bugs = xml.BugInstance
                                        def total = bugs.size()
                                        if (total <= 0) {
                                            log.info('No errors/warnings found')
                                            return
                                        }
                                        log.info('Total bugs: ' + total)
                                        for (i in 0..total-1) {
                                            def bug = bugs[i]
                                            log.info(
                                                bug.LongMessage.text()
                                                + ' ' + bug.Class.'@classname'
                                                + ' ' + 
bug.Class.SourceLine.Message.text()
                                            )
                                        }
if (project.properties['failOnError']) {
                                            fail(total + ' FindBugs error(s)')
                                        }
                                        ]]>
                                    </source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
{code}
                
> Add ability to show a summary of the bugs on the console
> --------------------------------------------------------
>
>                 Key: MFINDBUGS-118
>                 URL: https://jira.codehaus.org/browse/MFINDBUGS-118
>             Project: Maven 2.x FindBugs Plugin
>          Issue Type: New Feature
>            Reporter: Fabrício Lemos
>            Assignee: Garvin LeClaire
>            Priority: Trivial
>
> It is really important if findbugs runs as part of the build cycle.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to