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

Failing while building spotbugs version 4.2.3 using ./gradlew build #2961

Open
shivsrivastava opened this issue Apr 21, 2024 · 5 comments
Open

Comments

@shivsrivastava
Copy link

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

Copy link

welcome bot commented Apr 21, 2024

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.

@gtoison
Copy link
Contributor

gtoison commented Apr 21, 2024

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?

@shivsrivastava
Copy link
Author

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.

@shivsrivastava
Copy link
Author

shivsrivastava commented Apr 23, 2024

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?

@gtoison
Copy link
Contributor

gtoison commented Apr 23, 2024

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

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

No branches or pull requests

2 participants