spotbugs / spotbugs

SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

Home Page:https://spotbugs.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing while building spotbugs version 4.2.3 using ./gradlew build

shivsrivastava opened this issue · comments

Package artifact id: spotbugs

source code url: https://github.com/spotbugs/spotbugs/tree/4.2.3

Issue Description: Failing while building spotbugs version 4.2.3 using ./gradlew build

JDK Version: 11

Build CMD: ./gradlew build

MVN Version: NA

Error Log:

3 SpotBugs violations were found. See the report at: file:///C:/code/Code-Latest/spotbugs-annotations4.2.3/code/spotbugs/spotbugs/build/reports/spotbugs/test.html
org.gradle.api.GradleException: 3 SpotBugs violations were found. See the report at: file:///C:/code/Code-Latest/spotbugs-annotations4.2.3/code/spotbugs/spotbugs/build/reports/spotbugs/test.html
at com.github.spotbugs.snom.internal.SpotBugsRunnerForWorker$SpotBugsExecutor.execute(SpotBugsRunnerForWorker.java:115)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:49)
at org.gradle.workers.internal.AbstractClassLoaderWorker$1.create(AbstractClassLoaderWorker.java:43)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:97)
at org.gradle.workers.internal.AbstractClassLoaderWorker.executeInClassLoader(AbstractClassLoaderWorker.java:43)
at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:49)
at org.gradle.workers.internal.IsolatedClassloaderWorker.run(IsolatedClassloaderWorker.java:30)
at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:85)
at org.gradle.workers.internal.WorkerDaemonServer.run(WorkerDaemonServer.java:55)
at org.gradle.process.internal.worker.request.WorkerAction$1.call(WorkerAction.java:138)
at org.gradle.process.internal.worker.child.WorkerLogEventListener.withWorkerLoggingProtocol(WorkerLogEventListener.java:41)
at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:135)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
at java.base/java.lang.Thread.run(Thread.java:834)

Task :spotbugs:spotlessJavaCheck FAILED

FAILURE: Build failed with an exception.

failed_jdk_11.txt

attachment: build log attached (jdk 11)

OS: windows 10

Thanks for opening your first issue here! 😃
Please check our contributing guideline. Especially when you report a problem, make sure you share a Minimal, Complete, and Verifiable example to reproduce it in this issue.

SpotBugs 4.2.3 is 3 years old so I'm not sure why spotless seems to be failing the build here, I guess you can try gradlew spotlessApply to fix the style violations
May I ask why you're trying to build such an old version?

SpotBugs 4.2.3 is 3 years old so I'm not sure why spotless seems to be failing the build here, I guess you can try gradlew spotlessApply to fix the style violations May I ask why you're trying to build such an old version?

Hi , I do agree, we need to go for latest version but SpotBugs 4.2.3 is required in my project. I will check and confirm on it.

SpotBugs 4.2.3 is 3 years old so I'm not sure why spotless seems to be failing the build here, I guess you can try gradlew spotlessApply to fix the style violations May I ask why you're trying to build such an old version?

@gtoison Thanks a lot. I have one doubt, can we use the same command "gradlew spotlessApply" to build and to run test cases also?

spotlessApply modifies the code so it matches the formatting guidelines of the project (indentation, order of imports, that kind of things)
Once you have run it once, the source files are modified and spotless shouldn't complain anymore, but spotless won't build the project on its own.
You need to run gradlew test to run the tests