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

Gradle 8.1.1: Resolution of the configuration ... was attempted from a context different than the project context #913

Open
matthiaskraaz opened this issue Jun 27, 2023 · 3 comments

Comments

@matthiaskraaz
Copy link

matthiaskraaz commented Jun 27, 2023

I get lots and lots of message of this type for varying configurations:

Resolution of the configuration :jsource:osis:runtime:server:spotbugsPlugins was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behavior has been deprecated. This will fail with an error in Gradle 9.0. See https://docs.gradle.org/8.1.1/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors for more details

After a little drilldown I realize that this is probably not caused by the spotbugs plugin but the dependencycheck plugin, because the message is created FOR a spotbugs configuration, but also when executing just the dependencyCheckAggregate Task.

@KengoTODA
Copy link
Member

Could you share a mcve project to reproduce this issue? Thanks for your report!

@matthiaskraaz
Copy link
Author

I could not create a MCVE without dependency check. I am absolutely sure now, that depdenceny check is the culprit!

However, while trying to create the MCVE I stumbled about this:

plugins {
  id 'com.github.spotbugs' version '5.0.14'
}

apply plugin: 'java'

repositories {
  mavenCentral()
}

spotbugsMain {
/* Generates a warning:

The org.gradle.util.ClosureBackedAction type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.2.1/userguide/upgrading_version_7.html#org_gradle_util_reports_deprecations
        at build_a3rrfjmmvkuarj48u4gn03nvt$_run_closure2.doCall(C:\Users\MatthiasKraaz\temp\spotbugs_mcve\build.gradle:12)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
*/
  reports {
    xml.enabled = true
  }
/* Generates no warning:

  configure(reports) {
    xml.enabled = true
  }
*/
}

Not sure if this concerns you somehow. If it does, I can supply a MCVE for this...

@KengoTODA
Copy link
Member

The org.gradle.util.ClosureBackedAction type has been deprecated

It is a known issue, #616, waiting for action on the Gradle side.
I think it is not related to the problem you met firstly. 🤔

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