Plugin development: The configuration was resolved without accessing the project in a safe manner

I have a plugin that worked fine until 5.1.1. Now I get the warning from above. I’ve tried now for several hours to find out what happens and what I’d have to change and failed (including, of course, reading three times [didn’t help a bit]). I simply don’t get it. All I do is create a configuration for adding a dependency. Why has this become a problem?

class MDocletPlugin implements Plugin<Project> {
    final def CONFIGURATION_NAME = "org.jdrupes.mdoclet"

    void apply(Project project) {
        // create a new configuration for the doclet dependency
        def config = project.configurations.create(CONFIGURATION_NAME)

        // add the doclet dependency
        project.dependencies.add(CONFIGURATION_NAME, "org.jdrupes.mdoclet:doclet:1.0.3")

        // after the user buildscript is evaluated ...
        project.gradle.projectsEvaluated {
            // ... adjust the javadoc tasks
            project.tasks.withType Javadoc.class, {
                it.options {
                    def conf = project.configurations.getByName(CONFIGURATION_NAME)
                    docletpath = conf.files.asType(List)
                    doclet = "org.jdrupes.mdoclet.MDoclet"