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
79 stars 53 forks source link

fix outputDirectory not work at running spotbugs:spotbugs goal #807

Closed exiahuang closed 4 months ago

exiahuang commented 6 months ago

outputDirectory is not working pretty well when I try to run mvn spotbugs:spotbugs command. I think maybe the htmlTempFile should be use outputDirectory. Can you take a look of my PR, Thank you.

hazendaz commented 6 months ago

Thanks. Great catch. Will get merged and a release this weekend

Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Exia.huangxy @.> Sent: Wednesday, May 8, 2024 10:01:59 AM To: spotbugs/spotbugs-maven-plugin @.> Cc: Subscribed @.***> Subject: [spotbugs/spotbugs-maven-plugin] fix outputDirectory not work at running spotbugs:spotbugs goal (PR #807)

outputDirectoryhttps://spotbugs.github.io/spotbugs-maven-plugin/spotbugs-mojo.html#outputDirectory is not working pretty well when I try to run mvn spotbugs:spotbugs command. I think maybe the htmlTempFile should be use outputDirectory. Can you take a look of my PR, Thank you.


You can view, comment on, or merge this pull request online at:

https://github.com/spotbugs/spotbugs-maven-plugin/pull/807

Commit Summary

File Changes

(1 filehttps://github.com/spotbugs/spotbugs-maven-plugin/pull/807/files)

Patch Links:

— Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/pull/807, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHODI7SWMNJOCKSZ6AX53TZBIV5PAVCNFSM6AAAAABHNBGATOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4DKNRYGMZDCMY. You are receiving this because you are subscribed to this thread.Message ID: @.***>

hazendaz commented 6 months ago

@exiahuang Can you show what isn't working for you here? That location is a temp file and there are others in that same spot. project.build.directory is used in a lot of places.

exiahuang commented 6 months ago

@hazendaz

If I set outputDirectory at build tag, run mvnw spotbugs:spotbugs, the output of html is in target/spotbugs.html. not target/test-output-directory/spotbugs.html.

<build>
    <plugins>
        <plugin>
            <groupId>com.github.spotbugs</groupId>
            <artifactId>spotbugs-maven-plugin</artifactId>
            <!-- <version>4.8.5.1-SNAPSHOT</version> -->
            <version>4.8.5.0</version>
            <dependencies>
                <dependency>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs</artifactId>
                <version>4.8.5</version>
                </dependency>
            </dependencies>
            <configuration>
                <htmlOutput>true</htmlOutput>
                <outputDirectory>target/test-output-directory</outputDirectory>
            </configuration>
        </plugin>
    </plugins>
</build>

I Think htmlTempFile is not just a temp file, it is not like xmlTempFile and sarifTempFile, because they will be deleted, but htmlTempFile is never.

hazendaz commented 6 months ago

ok I'll need to look more at it. Currently this PR breaks the integration tests....

exiahuang commented 6 months ago

@hazendaz Can you Run the workflows again? I fix the test code.

exiahuang commented 6 months ago

@hazendaz There are some thing wrong with JDK23 test. I don't think it's my fault, but I don't know how to fix it.

hazendaz commented 6 months ago

Jdk 23 is a known and reported issue to error prone. It only started appearing couple days ago when github updated to latest build.

Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Exia.huangxy @.> Sent: Tuesday, May 28, 2024 9:37:44 AM To: spotbugs/spotbugs-maven-plugin @.> Cc: Jeremy Landis @.>; Mention @.> Subject: Re: [spotbugs/spotbugs-maven-plugin] fix outputDirectory not work at running spotbugs:spotbugs goal (PR #807)

@hazendazhttps://github.com/hazendaz There are some thing wrong with JDK23 test. I don't think it's my fault, but I don't know how to fix it.

— Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-maven-plugin/pull/807#issuecomment-2135241128, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHODI2A5U6P33LJB2GK2TDZESCCRAVCNFSM6AAAAABHNBGATOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZVGI2DCMJSHA. You are receiving this because you were mentioned.Message ID: @.***>