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

Fix lifecycle mapping metadata #69

Closed KengoTODA closed 2 years ago

KengoTODA commented 5 years ago

I've fixed <goal> in META-INF/m2e/lifecycle-mapping-metadata.xml, however this fix isn't enough to run SpotBugs from m2e. I've installed 3.1.6-SNAPSHOT in local, and confirmed that its goal is linked with lifecycle:

screenshot from 2018-07-02 09-31-56

But even when I clean the Eclipse project, it won't run SpotBugs. At least, I found nothing in in progress bar, and no report founds in target directory.

hazendaz commented 5 years ago

https://stackoverflow.com/questions/30596850/how-to-combine-the-update-of-a-m2e-maven-project-in-eclipse-with-a-maven-build

It appears because the 'check' is in the VERIFY phase, a package will need run so eclipse is not going to do anything past compile. I think if you test again changing that phase for the test to compile you are likely to get it working. Then the question is, do we want that in the compile phase?

KengoTODA commented 5 years ago

I think compile phase isn't good. At least, currently SpotBugs doesn't support incremental analysis, then analysis on compile phase should make development experience really bad.

e-shreve-ti commented 5 years ago

Any chance this fix can be finished? Looks like a test was failing against the change, but that the test needs to be updated. Would be nice to have this fix build in rather than requiring users to specify the correct lifecycle management setting themselves.

hazendaz commented 5 years ago

@e-shreve-ti Would this solve your issue -> here They are supporting spotbugs now with m2e integration.

e-shreve-ti commented 5 years ago

Sorry. PEBCAK. I knew of m2e-code-quality but missed that they had multiple features and had only installed their checkstyle feature.

hazendaz commented 5 years ago

@KengoTODA Can you rebase this and get working what you did? While it doesn't fix everything, if I recall it was useful and with now m2e-code-quality already working with us, we may not yet need a full solution. We probably could leverage what they have done and/or just drop this entirely and point users to their support.

hazendaz commented 2 years ago

merging, will add missing spotbugs and new verify goals separately. Also looking at m2e-code -quality to see about just introducing that code directly.