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

How to auto-link spotbugs report into mvn site report? #248

Closed davewichers closed 3 years ago

davewichers commented 3 years ago

I've followed these instructions: https://spotbugs.github.io/spotbugs-maven-plugin/usage.html to automatically run spotbugs and generate spotbugs.html report when I run: mvn site for my project (per https://github.com/nahsra/antisamy/blob/master/pom.xml).

However, many Maven plugins, when included in the reporting section cause the report they generate to be linked to from the Project Documentation menu in the top left of all the reports.

For example, if you look at my pom, I'm also generating 3 other reports using 2 other plugins (maven-project-info-reports-plugin and versions-maven) and those reports get linked into the Project Documentation block.

To see this yourself, clone the project, then run: mvn compile site, and open up project-reports.html in /target/site and you'll see the 3 reports are all interconnected using the same left menu.

Is there a way to configure the spotbugs-maven-plugin in the reporting section of my pom so the spotbugs.html report is integrated in a similar way?

I tried simply adding the following to my spotbugs-maven-plugin configuration and that didn't work.

<reportSets>
  <reportSet>
    <reports>
      <report>spotbugs</report>
    </reports>
</reportSet>

If this plugin doesn't support this integration feature, can you add support for it?

hazendaz commented 3 years ago

I don't see an issue here with spotbugs. I can say your configuration on maven project info reports is not correct. You end up losing the index.html to get into the reports. But ignoring that, project reports does show spotbugs and the left hand side further shows spotbugs as well.

image

hazendaz commented 3 years ago

In how you have setup versions plugin, it works exactly as it should. I might suggest you add fluido-skip to your site so it looks nicer and add in more for maven info reports or just uses it's defaults so you get a nicer look at feel plus many of the items that are missing now besides spotbugs.

davewichers commented 3 years ago

Hey. Sorry, I apparently messed up my SpotBugs mvn configuration which is why I wasn't seeing SpotBugs in the menu. When I ran this on the latest master branch, like you did, it is in the menu. So false alarm on that score. Thanks for the feedback. 2 questions/comments:

1) You mention: "I can say your configuration on maven project info reports is not correct. You end up losing the index.html to get into the reports." I see that. Do you have a suggestion on how to make my configuration 'correct' to fix that? 2) I'll give fluido-skip a shot. I've never heard of it before.

hazendaz commented 3 years ago

Now that I've clone your repo, I don't mind sending a quick pull request later tonight for that.

Get Outlook for Androidhttps://aka.ms/ghei36


From: Dave Wichers notifications@github.com Sent: Monday, August 17, 2020 10:53:45 AM To: spotbugs/spotbugs-maven-plugin spotbugs-maven-plugin@noreply.github.com Cc: Jeremy Landis jeremylandis@hotmail.com; Comment comment@noreply.github.com Subject: Re: [spotbugs/spotbugs-maven-plugin] How to auto-link spotbugs report into mvn site report? (#248)

Hey. Sorry, I apparently messed up my SpotBugs mvn configuration which is why I wasn't seeing SpotBugs in the menu. When I ran this on the latest master branch, like you did, it is in the menu. So false alarm on that score. Thanks for the feedback. 2 questions/comments:

  1. You mention: "I can say your configuration on maven project info reports is not correct. You end up losing the index.html to get into the reports." I see that. Do you have a suggestion on how to make my configuration 'correct' to fix that?
  2. I'll give fluido-skip a shot. I've never heard of it before.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/issues/248#issuecomment-674929544, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHODI5LOJWHMTSNTUVPVZ3SBE77TANCNFSM4QAZWJOA.

hazendaz commented 3 years ago

I'll try to get back to this tomorrow and bring you a PR.

Fluido is a skin that maven provides. Their newer sites are all generated from it. Its pretty easy to use. It gives it a much more fresh look than the really old apache default.

davewichers commented 3 years ago

Can you get to this anytime soon?

hazendaz commented 3 years ago

@davewichers Sorry for the delay. I sent a PR-50. If you run that site now, it will produce the index.html page and use fluido. You may want to adjust the image I used. I tried to find something around owasp and just pulled from their site. Its a little big so this only had a left side banner. However, it demonstrates well how much nicer fluido looks than the legacy look and feel.

davewichers commented 3 years ago

The problems I had were a misconfiguration on my part. Nothing wrong with spotbugs-maven-plugin in this regard.