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

[BUG] Disabling spotbugsIntegrationTest Task in Separate Gradle Configuration File #951

Open
CedricNdong opened this issue Aug 16, 2023 · 2 comments

Comments

@CedricNdong
Copy link

Describe the bug
When attempting to disable the spotbugsIntegrationTest task in a separate spotbugs.gradle file and then applying this file in the main build.gradle, I encounter a groovy.lang.MissingPropertyException for the task spotbugsIntegrationTest, even though this task exists.

To Reproduce
Steps to reproduce the behavior:

  1. Add the SpotBugs plugin with version 5.0.14 in the build.gradle file.
  2. Create a new spotbugs.gradle file in the project's root directory with the content:
    spotbugsIntegrationTest.enabled = false

image

3.In the build.gradle file, apply the SpotBugs plugin with apply from: "$rootDir/spotbugs.gradle"
4. Execute the Gradle task to see the error:
5. See error

Expected behavior
The spotbugsIntegrationTest task should be disabled and not run during the build.

Actual behavior
I receive the following error:
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'spotbugsIntegrationTest' for root project '...' of type org.gradle.api.Project.

Environment
Gradle version: 7.4.2
SpotBugs plugin version: 5.1.1
Java version: openjdk 17.0.6 2023-01-17
Operating System: Windows 11

Additional context
I've attempted to use lazy configuration with tasks.named('spotbugsIntegrationTest').configure, but the issue persists.

@CedricNdong CedricNdong changed the title Disabling spotbugsIntegrationTest Task in Separate Gradle Configuration File [BUG] Disabling spotbugsIntegrationTest Task in Separate Gradle Configuration File Aug 16, 2023
@KengoTODA
Copy link
Member

Thanks for your report, could you try two more approaches:

  • Bump up Gradle to 7.6.2 at least, or 8.2.1 if possible
  • Bump up spotbugs-gradle-plugin to 6.0.0-beta.3

@pro100yevhen
Copy link

Hey there! I encountered a similar issue. My project structure looks like this:

src:
- integrationTest
- main
- test
- pactTest

I'm using Gradle version 8.2.1 and the SpotBugs plugin version 6.0.14. Any insights or suggestions on how to resolve this would be much appreciated!
image

The error:
A problem occurred evaluating root project 'skarb-ngo'.

Could not find method spotbugsIntegrationTest() for arguments [build_12mb3e7o58k220dky36lig4uu$_run_closure3$_closure17@513b5b3f] on project ':kafka-starter' of type org.gradle.api.Project.

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

3 participants