I’m trying to upgrade an ancient build without changing what’s actually produced so that other things downstream don’t also break.
The old build configures its artifacts as follows (simplified to remove lots of other artifacts):
artifacts {
archives jar
archives confJar
conffiles confJar
}
After way too much searching, I’ve come up with the following modern code:
publications {
ivy(IvyPublication) {
configurations {
archives {}
conffiles {}
}
artifact(jar) {
conf 'archives'
}
artifact(confJar) {
conf "archives,conffiles"
}
}
}
Unfortunately, it’s still not right, as the dependencies aren’t being published. I used to be able to declare a dependency like compile(group: 'foo', name: 'bar', version: '1.0.0')
and have it pull in the entire dependency tree of my foo:bar:1.0.0, or conffiles(group: 'foo', name: 'bar', version: '1.0.0', configuration: 'conffiles')
and get all the configuration jars all the way down; but now the Ivy file just has <dependencies/>
and I only pull in the direct artifact and not the tree.
I found an old bug report that said to wrap the whole publications {}
block in an afterEvaluate{}
, but that didn’t help - I’m still getting an empty <dependencies/>
.
How do I replicate the old publishing behavior? Or, if it’s simply not possible, how do I accomplish the same goal?