Dependency on javadocElements not causing javadoc to build

Hello all!

We have a multi-project build where the super-project gathers sub-project elements with the following technique:

configurations
{
    doc
    lib
    zip
}

dependencies
{
    doc project(path: ':cip-r2c3-api', configuration: 'javadocElements')

    lib project(':cip-r2c3-api')
    lib project(':cip-r2c3-core')
    lib project(':cip-r2c3-rest')

    zip project(path: ':cip-r2c3-tool', configuration: 'zip')
}

build.doLast {
    copy {
        into "build/install/prodist-${name}-${version}"
        into ('doc') { from 'doc' }
        configurations.doc.resolvedConfiguration.resolvedArtifacts.each {
            artifact -> into ("doc/${artifact.name}") { from zipTree(artifact.file) }
        }
        into ('lib') { from configurations.lib }
        into ('zip') { from configurations.zip }
        from 'README.md'
        from 'RELEASE.md'
    }
}

In a pristine project, running ./gradlew build results in:

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\prodist\src\cip-r2c3-jvm\build.gradle' line: 65

* What went wrong:
Execution failed for task ':build'.
> Cannot expand ZIP 'E:\prodist\src\cip-r2c3-jvm\api\build\libs\cip-r2c3-api-1.0.0-SNAPSHOT-javadoc.jar' as it does not exist.

We expected that a dependency would be wired from build to the generator of project(path: ':cip-r2c3-api', configuration: 'javadocElements').
Are we missing something?

This is the result of gradlew --version:

------------------------------------------------------------
Gradle 6.5.1
------------------------------------------------------------

Build time:   2020-06-30 06:32:47 UTC
Revision:     66bc713f7169626a7f0134bf452abde51550ea0a

Kotlin:       1.3.72
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.7 (AdoptOpenJDK 11.0.7+10)
OS:           Windows 10 10.0 amd64

With Gradle 6.7, the following alternative:

configurations
{
    doc
    jar
    zip
}

dependencies
{
    doc project(path: ':pix-dict-api', configuration: 'javadocElements')
    doc project(path: ':pix-dict-mock', configuration: 'javadocElements')
    doc group: 'prodist-jvm', name: 'java-sts', version: '[1.1, 2.0)', classifier: 'javadoc'

    jar project(path: ':pix-dict-markup', configuration: 'javadocElements')
    jar project(path: ':pix-dict-core')
    jar project(path: ':pix-dict-markup')
    jar project(path: ':pix-dict-markup', configuration: 'javadocElements')
    jar project(path: ':pix-dict-transport')
    jar project(path: ':pix-dict-transport', configuration: 'javadocElements')
    jar group: 'prodist-jvm', name: 'java-sts', version: '[1.1, 2.0)'
    jar group: 'prodist-jvm', name: 'java-sts', version: '[1.1, 2.0)', classifier: 'javadoc'

    zip project(path: ':pix-dict-markup-tui', configuration: 'zip')
    zip project(path: ':pix-dict-mock', configuration: 'zip')
    zip project(path: ':pix-dict-transport-tui', configuration: 'zip')
    zip project(path: ':pix-dict-tool', configuration: 'zip')
    zip group: 'prodist-jvm', name: 'java-sts-tool', version: '[1.1, 1.2)', ext: 'zip'
}

never fails, but, doesn’t copy the pix-dict-api-${version}-javadoc.jar. It does copy doc configuration dependencies, though. It smells like a race. Is this supposed to work?