Upgrading ancient build: publishing Ivy dependencies

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?

Generally, to get proper dependencies, you should publish a component, not plain artifacts.
Whether you can use the java component or should create an own one, or how to configure them, I cannot tell you from the top of my head though.

Considering this more, I think the issue is that the old build automatically pulled all my configurations and all my dependencies directly from my build and put them into the Ivy manifest, whether or not I needed them (seriously, the Ivy manifest I just pulled up has 57 different configurations listed in it); but this IvyPublication is starting fresh. Somehow I need to tell Gradle “Copy build configurations X, Y, and Z into the Ivy manifest.”