spotbugs-gradle-plugin icon indicating copy to clipboard operation
spotbugs-gradle-plugin copied to clipboard

[BUG] Disabling spotbugsIntegrationTest Task in Separate Gradle Configuration File

Open CedricNdong opened this issue 1 year ago • 2 comments

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 avatar Aug 16 '23 13:08 CedricNdong