Open parveen-bhatia opened 6 months ago
Could you run your build with --debug
option, then it will print the argument applied to the build.
Thanks for the response.
I haven't provided -sourcepath
value below, as this is sensitive information (LIST_NOT_PROVIDED_SENSITIVE_INFO) but -sourcepath
value is around ~190605
chars
Below is the snippet of some debug logs after running ./gradlew spotbugsStandardRelease --debug
2024-04-30T17:09:39.229+0000 [DEBUG] [com.github.spotbugs.snom.internal.SpotBugsRunner] Arguments for SpotBugs are generated: [-timestampNow, -auxclasspathFromFile, /builds/appian/dev/android-client/appian-android/build/spotbugs/auxclasspath/spotbugsStandardRelease, -sourcepath, {xyz.java ... (LIST_NOT_PROVIDED_SENSITIVE_INFO)}, -html=/builds/appian/dev/android-client/spotbugs/reports/standardRelease.html, -xml:withMessages=/builds/appian/dev/android-client/spotbugs/reports/standardRelease.xml, -effort:max, -visitors, SynchronizeAndNullCheckField,InitializeNonnullFieldsInConstructor,InitializeNonnullFieldsInConstructor,BooleanReturnNull,OptionalReturnNull,FinalizerNullsFields,InconsistentAnnotations,FindNullDeref,BadUseOfReturnValue, -exclude, /builds/appian/dev/android-client/spotbugs/project_exclude.xml, -excludeBugs, /builds/appian/dev/android-client/spotbugs/spotbugs_baseline.xml, -onlyAnalyze, , -projectName, appian-android (spotbugsStandardRelease), -release, 24.3, -analyzeFromFile, /builds/appian/dev/android-client/appian-android/build/spotbugsStandardRelease-analyse-class-file.txt, -nested:false]
2024-04-30T17:09:39.233+0000 [DEBUG] [com.github.spotbugs.snom.internal.SpotBugsRunner] Arguments for JVM process are generated: [-XX:MaxHeapSize=1g]
....
....
....
2024-04-30T17:09:41.062+0000 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2024-04-30T17:09:41.070+0000 [INFO] [com.github.spotbugs.snom.internal.SpotBugsRunnerForHybrid$SpotBugsExecutor$Inject] Spotbugs will be executed using Java Toolchain configuration: /opt/java/openjdk/bin/java
2024-04-30T17:09:41.079+0000 [INFO] [org.gradle.process.internal.JavaExecHandleBuilder] Shortening Java classpath [xyz.jar ...] with /home/appian/.gradle/.tmp/gradle-javaexec-classpath3822330201620710010.jar
2024-04-30T17:09:41.080+0000 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/opt/java/openjdk/bin/java''. Working directory: /builds/appian/dev/android-client/appian-android Command: /opt/java/openjdk/bin/java -XX:MaxHeapSize=1g -Xmx1g -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant -cp /home/appian/.gradle/.tmp/gradle-javaexec-classpath3822330201620710010.jar edu.umd.cs.findbugs.FindBugs2 -exitcode -timestampNow -auxclasspathFromFile /builds/appian/dev/android-client/appian-android/build/spotbugs/auxclasspath/spotbugsStandardRelease -sourcepath {xyz.java ... (LIST_NOT_PROVIDED_SENSITIVE_INFO)} -html=/builds/appian/dev/android-client/spotbugs/reports/standardRelease.html -xml:withMessages=/builds/appian/dev/android-client/spotbugs/reports/standardRelease.xml -effort:max -visitors SynchronizeAndNullCheckField,InitializeNonnullFieldsInConstructor,InitializeNonnullFieldsInConstructor,BooleanReturnNull,OptionalReturnNull,FinalizerNullsFields,InconsistentAnnotations,FindNullDeref,BadUseOfReturnValue -exclude /builds/appian/dev/android-client/spotbugs/project_exclude.xml -excludeBugs /builds/appian/dev/android-client/spotbugs/spotbugs_baseline.xml -onlyAnalyze -projectName appian-android (spotbugsStandardRelease) -release 24.3 -analyzeFromFile /builds/appian/dev/android-client/appian-android/build/spotbugsStandardRelease-analyse-class-file.txt -nested:false
2024-04-30T17:09:41.085+0000 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
2024-04-30T17:09:41.085+0000 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command '/opt/java/openjdk/bin/java'.
2024-04-30T17:09:41.093+0000 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: FAILED
2024-04-30T17:09:41.093+0000 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/opt/java/openjdk/bin/java'' finished with exit value -1 (state: FAILED)```
Hi @KengoTODA or @rpalcolea any idea what can be wrong or anything else i can try. Please let me know if any more information is required.
Currently SpotBugs has no sourcepathFromFile
or similar solution, so what I can suggest is just to shorten the sourcepath.
I filed a similar issue https://github.com/spotbugs/spotbugs-gradle-plugin/issues/1176. Shortening the sourcepath will be difficult for my project. Any other suggestions? Is it possible to build sourcepathFromFile
solution?
Hi, i am using gradle plugin for the android project with below build.gradle.
On my local with MacOS,
./gradlew spotbugsStandardRelease
task works successfully and able to generate reports. However on CI (which uses linux based docker with eclipse-temurin-17), i am getting below error:Following is the list of versions:
I tried enabling useAuxclasspathFile = true, which is as per https://github.com/spotbugs/spotbugs-gradle-plugin/pull/243. But still getting the issue.