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 not running, and no -text #31

Closed
xenoterracide opened this issue Jun 1, 2018 · 3 comments · Fixed by #106
Closed

spotbugs not running, and no -text #31

xenoterracide opened this issue Jun 1, 2018 · 3 comments · Fixed by #106
Assignees
Labels
Milestone

Comments

@xenoterracide
Copy link

xenoterracide commented Jun 1, 2018

going a little crazy trying to figure out what's going wrong, I moved my configuration to a plugin, but it seems that it's not working

> Task :check
Skipping task ':check' as it has no actions.
:check (Thread[Task worker for ':',5,main]) completed. Took 0.0 secs.

> Task :spotbugsMain FAILED
:spotbugsMain (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 2.139 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotbugsMain'.
> Unknown option: -text

* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':spotbugsMain'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249)
        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:596)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.IllegalArgumentException: Unknown option: -text
        at edu.umd.cs.findbugs.config.CommandLine.parse(CommandLine.java:333)
        at edu.umd.cs.findbugs.config.CommandLine.expandOptionFiles(CommandLine.java:180)
        at edu.umd.cs.findbugs.FindBugs.processCommandLine(FindBugs.java:344)
        at com.github.spotbugs.internal.spotbugs.SpotBugsExecuter.runSpotbugs(SpotBugsExecuter.java:22)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:101)
        at org.gradle.process.internal.worker.request.WorkerAction.runThenStop(WorkerAction.java:84)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        ... 3 more


* Get more help at https://help.gradle.org

https://bitbucket.org/xenoterracide/gradle-plugin-bundle/src/19c9dbf00f740e7498fa5504921980e08fe00d21/src/main/java/com/xenoterracide/gradle/plugin/configurations/SpotBugs.java?at=master

disabling text allows it to run calling spotbugsMain to work though these codes seem a bit unreadable?

L V MS: com.xenoterracide.rpf.constant.Profiles.PROD isn't final but should be  At Profiles.java:[line 4]
L D UrF: Unread public/protected field: com.xenoterracide.rpf.constant.Profiles.PROD  At Profiles.java:[line 4]

but then check still isn't running it. I've got my addon configured like this

plugins {
    id("com.xenoterracide.gradle.java-lib").version("0.2.9") // 0.2.9 has text disabled 0.2.8 has it enabled
}
xeno {
    sourceSets = listOf(java.sourceSets["main"])
}
@KengoTODA
Copy link
Member

please consider to share minimal project that can reproduce this issue.

@xenoterracide
Copy link
Author

my code is completely open source, you can use it to simply reproduce, but honestly this has been an issue for 9 months and the workaround was to stop specifying text explicitly so... you can use a checkout of the sha1 given... or since the api has been broken in a backwards incompatible way for so long... just leave it broken I guess.... I don't have time to find reproduction steps 8 months later

@Vampire
Copy link

Vampire commented Feb 11, 2019

The problem here is that the Gradle plugin accepts enabling a report called text (besides html, emacs and the default xml).
When calling spotbugs, the plugin translates this to an option -<reportname>, but -text is not a valid report (anymore?).

Just run a build with

tasks.withType(SpotBugsTask) {
    reports {
        xml.enabled false
        text.enabled true
    }
}

and you can reproduce the issue easily.
On the other hand, a configurable xdocs mode is missing in the plugin.

KengoTODA added a commit that referenced this issue Feb 11, 2019
KengoTODA added a commit that referenced this issue Feb 11, 2019
@KengoTODA KengoTODA self-assigned this Feb 11, 2019
@KengoTODA KengoTODA added this to the 1.6.10 milestone Feb 14, 2019
@KengoTODA KengoTODA added the bug label Feb 14, 2019
KengoTODA added a commit that referenced this issue Feb 18, 2019
KengoTODA added a commit that referenced this issue Feb 18, 2019
KengoTODA added a commit that referenced this issue Feb 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants