How to run spotbugs from command line?

Viewed 33

There is a need of executing spotbugs from command line, i have got some information from the google search however i'm running into some problems. Somebody please help me providing an example to get it work. I'm running spotbugs however the usage says i need to use findbugs and i'm confused.

I'm using : SPOTBUGS version 4.7.2

Command that im using : java -jar spotbugs.jar -textui -effort:default -sortByClass=/tmp/sportbugs.txt -low -html=/tmp/sbugs.html -sourcepath /tmp/Program

ERROR BELOW:

    Unexpected problem occured during version sanity check
    Reported exception:
    java.lang.AbstractMethodError: 
    org.apache.logging.slf4j.SLF4JServiceProvider.getRequestedApiVersion()Ljava/lang/String;
    at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:297)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:141)
    at org.slf4j.LoggerFactory.getProvider(LoggerFactory.java:421)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:407)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:356)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:382)
    at edu.umd.cs.findbugs.CheckBcel.<clinit>(CheckBcel.java:40)
    at edu.umd.cs.findbugs.LaunchAppropriateUI.launch(LaunchAppropriateUI.java:99)
    at edu.umd.cs.findbugs.LaunchAppropriateUI.main(LaunchAppropriateUI.java:198)
    Sep 07, 2022 11:11:22 AM edu.umd.cs.findbugs.FindBugs processCommandLine
    WARNING: No files to be analyzed
    Sep 07, 2022 11:11:22 AM edu.umd.cs.findbugs.FindBugs showSynopsis
    WARNING: Usage: findbugs [general options] -textui [command line options...] 
    [jar/zip/class files, directories...]
0 Answers
Related