spotbugs / spotbugs-maven-plugin

Maven Mojo Plug-In to generate reports based on the SpotBugs Analyzer
https://spotbugs.github.io/spotbugs-maven-plugin/
Apache License 2.0
69 stars 51 forks source link

Plugin bug descriptions do not show in GUI #10

Closed jasonab closed 6 years ago

jasonab commented 6 years ago

I'm not sure if I should file this here or in the GUI project, but since I run the GUI through the maven plugin, I'll start here.

I have several plugins configured to run through the maven plugin:

<plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>3.1.0-RC6</version>
                <configuration>
                    <plugins>
                        <plugin>
                            <groupId>com.mebigfatguy.fb-contrib</groupId>
                            <artifactId>fb-contrib</artifactId>
                            <version>LATEST</version>
                        </plugin>
                        <plugin>
                            <groupId>com.h3xstream.findsecbugs</groupId>
                            <artifactId>findsecbugs-plugin</artifactId>
                            <version>LATEST</version>
                        </plugin>
                        <plugin>
                            <groupId>jp.skypencil.findbugs.slf4j</groupId>
                            <artifactId>bug-pattern</artifactId>
                            <version>LATEST</version>
                        </plugin>
                    </plugins>
                </configuration>
            </plugin>

and they run and generate bugs. But, when I run mvn spotbugs:gui they show up as "Unknown Bug Pattern" and I don't see the JARs in the classpath.

iloveeclipse commented 6 years ago

Can you please change to the latest version and verify again?

jasonab commented 6 years ago

I still see it with these versions: spotbugs-maven-plugin-3.1.0-20170923.035155-1 spotbugs-3.1.0-RC5 fb-contrib 7.0.5sb

iloveeclipse commented 6 years ago

The latest spotbugs version is 3.1.0.

jasonab commented 6 years ago

I still see it with 3.1.0 on the same Maven plugin snapshot

hazendaz commented 6 years ago

@jasonab Is this related to this -> here

@iloveeclipse I haven't released official 3.1.0 cut yet. Because it looks like the issue with gui might be fixed now as it had previously attempted PR that needs cleaned up and seems developer trying to fix it might have it addressed soon, I'll wait a bit to pick that up. Hopefully it is same issue as this here.

jasonab commented 6 years ago

@hazendaz seems like that might very well be the case

VsevolodGolovanov commented 6 years ago

It's done.

hazendaz commented 6 years ago

thanks @VsevolodGolovanov

hazendaz commented 6 years ago

@jasonab Can you try version 3.1.0-RC7 of spotbugs-maven-plugin and let me know if this issue is addressed?

jasonab commented 6 years ago

Well, now I'm getting a different error: [ERROR] Failed to execute goal com.github.spotbugs:spotbugs-maven-plugin:3.1.0-RC7:gui (default-cli) on project user-management-service: Execution default-cli of goal com.github.spotbugs:spotbugs-maven-plugin:3.1.0-RC7:gui failed: java doesn't support the nested "getThresholdParameter" element.: The type doesn't support the nested "getThresholdParameter" element. -> [Help 1]

This is using RC7 of the maven plugin, and 3.1.0 of spotbugs. I was using plugins as well, but removing them did not eliminate the error.

VsevolodGolovanov commented 6 years ago

https://github.com/spotbugs/spotbugs-maven-plugin/commit/02d107c87988267c55eb5df40ccb4bb12cfccc41

hazendaz commented 6 years ago

@VsevolodGolovanov I"m unfamiliar with this piece. It doesn't look like the code is correct. Simple run of the gui fails as @jasonab indicated. I moved the threshold method into the findbugs trait class. Then it complianed that there was no threshold so I assumed that was in the wrong place. However, adding the threshold, it then crashes because threshold is not a valid option to gui. So I commented that out, now it opens. I'm not sure what the end use case is so I'm a bit worried about sending a PR.

So essentially, I think

spotbugsArgs << getThresholdParameter()

Does not belong in the GUI code. Can you confirm?

VsevolodGolovanov commented 6 years ago

I don't understand the intent either. I just checked that it wasn't my subj-related code that added the issue. Then I posted the likely offending commit to save others some time looking for it. I should've been more clear about all this in my previous comment.

I created FindBugsPluginsTrait to consolidate the FindBugs plugins related logic, so this commit doesn't make sense to me at all on the code structure level.

hazendaz commented 6 years ago

@gleclaire Can you help out here?

gleclaire commented 6 years ago

Yes I accidentally checked in some code I was working on to have the gui have the parameters the command line does.
I will fix and commit. Unfortunately I have not found a good way to do automated integration tests for the gui

hazendaz commented 6 years ago

Thanks @gleclaire

@VsevolodGolovanov I have released 3.1.0-RC8. Can you take a look and let me know if this solves the overall issue?

jasonab commented 6 years ago

My apologies for the delayed feedback here. RC8 appears to solve the problem for me.

hazendaz commented 6 years ago

@jasonab Thanks! I'll close this ticket now.

urbandroid commented 6 years ago

Document at http://spotbugs.readthedocs.io/en/latest/maven.html should reference RC8 since RC7 has this issue.

hazendaz commented 6 years ago

@urbandroid Can you report that over on spotbugs? 3.1.1 of this plugin was released so no override is needed now.

hazendaz commented 6 years ago

Or actuallly not even sure where to open that for a fix myself. @iloveeclipse where do we update the doc for maven information? This issue is fixed on 3.1.1 release and we should reference the right version on the docs. I sort of think that comes out of spotbugs itself as I found the source page but it has a bunch of variables and not sure where those are set to show the right stuff.

iloveeclipse commented 6 years ago

where do we update the doc for maven information?

Readthedocs has a good feature: on every page you read you see the link in the top right corner "Edit on GitHub". In current case this would be https://github.com/spotbugs/spotbugs/blob/master/docs/maven.rst.