Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpotBugs targets fail when we have more than one plugin in Unix-like systems #255

Closed
tharakadesilva opened this issue Apr 22, 2024 · 0 comments · Fixed by #256
Closed

SpotBugs targets fail when we have more than one plugin in Unix-like systems #255

tharakadesilva opened this issue Apr 22, 2024 · 0 comments · Fixed by #256

Comments

@tharakadesilva
Copy link
Contributor

tharakadesilva commented Apr 22, 2024

rules_jvm_external changes:

maven.artifact("com.mebigfatguy.sb-contrib", "sb-contrib", "7.6.4"),
maven.artifact("jp.skypencil.findbugs.slf4j", "bug-pattern", "1.4.2"),

The spotbugs_config:

spotbugs_config(
    name = "spotbugs-default-config",
    effort = "max",
    fail_on_warning = True,
    plugin_list = [
        "@maven//:com_h3xstream_findsecbugs_findsecbugs_plugin",
        "@maven//:com_mebigfatguy_sb_contrib_sb_contrib",
    ],
    visibility = [
        "//visibility:public",
    ],
)

The script that is generated:

#!/usr/bin/env bash
ERRORLOG=$(mktemp)
RES=`../contrib_rules_jvm/java/spotbugs_cli -textui -effort:max -pluginList ../maven_spring/com/h3xstream/findsecbugs/findsecbugs-plugin/1.13.0/findsecbugs-plugin-1.13.0.jar;../maven_spring/com/mebigfatguy/sb-contrib/sb-contrib/7.6.4/sb-contrib-7.6.4.jar libs/my-lib/libmy-lib.jar 2>$ERRORLOG`
SPOTBUGS_STATUS=$?
if [ $SPOTBUGS_STATUS != 0 ]; then
  echo >&2 "spotbugs exited with unexpected code $SPOTBUGS_STATUS"
  cat >&2 $ERRORLOG
  exit $SPOTBUGS_STATUS
fi
echo "$RES"
if [ -n "$RES" ]; then
   exit 1
fi

The error received:

Apr 22, 2024 4:48:34 PM edu.umd.cs.findbugs.FindBugs processCommandLine
WARNING: No files to be analyzed
Apr 22, 2024 4:48:34 PM edu.umd.cs.findbugs.FindBugs showSynopsis
WARNING: Usage: findbugs [general options] -textui [command line options...] [jar/zip/class files, directories...]
spotbugs exited with unexpected code 2

The error seems to be here.

The semi-colon ; is being interpreted as a command separator rather than a separator for the plugin list. Changing it to colon : fixes the issue.

shs96c pushed a commit that referenced this issue Apr 23, 2024
Closes #255 

---

The semi-colon `;` is being interpreted as a command separator rather
than a separator for the plugin list. Changing it to colon `:` fixes the
issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant