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