"Configuration was resolved without accessing the project in a safe manner", but there's no cross-project access

Previously, I struggled with the new warnings about resolving configurations. I’ve never understood what the correct usage of the API is. The docs “generally” describe what you should do, but here I have a case which I believe meets all the requirements, and yet I’m getting the warning anyway:

This is causing a warning on line 44 with Gradle 5.6. Looking at the suggestions from the docs:

  • A task from one project directly resolves a configuration in another project. no cross-project
  • A task specifies a configuration from another project as an input file collection. no cross-project
  • A build script for a project resolves a configuration in another project during evaluation. no cross-project
  • A configuration is resolved in a user-managed thread (i.e., a thread not managed by Gradle). uses gradle’s own afterProject callback

GitHub issue for this particular example: https://github.com/mnlipp/jdrupes-mdoclet/issues/3

What are the rules for resolving a configuration?

1 Like