Publish an extra ivy file that lists all the other projects as a list of dependencies.
<ivy-module version="2.0">
<info organisation="my.org.name" module="projects" revision="1.0.0" status="release" publication="20130215110241"/>
<dependencies>
<dependency org="my.org.name" name="projectA" rev="1.0.0"/>
<dependency org="my.org.name" name="projectB" rev="1.0.0"/>
<dependency org="my.org.name" name="projectC" rev="1.0.0"/>
..
..
</dependencies>
</ivy-module>
Creating a single dependency against this special ivy module will then pull in the other project artifacts as transitive dependencies.
<dependency org="my.org.name" name="projects" rev="1.0.0"/>
Enhancement
You could go one further and create different configurations to categorize your projects' artifacts:
<ivy-module version="2.0">
<info organisation="my.org.name" module="projects" revision="1.0.0" status="release" publication="20130215110241"/>
<configurations>
<conf name="web-apps" description="Projects which provide functionality for webapps"/>
<conf name="standalone" description="Projects which provide functionality for stand-alone java apps"/>
</configurations>
<dependencies>
<dependency org="my.org.name" name="projectA" rev="1.0.0" conf="webapps->default"/>
<dependency org="my.org.name" name="projectB" rev="1.0.0" conf="standalone->default"/>
<dependency org="my.org.name" name="projectC" rev="1.0.0" conf="webapps->default;standalone->default"/>
</dependencies>
</ivy-module>
Configurations are an extremely useful ivy feature. Client builds can use mappings to pull in artifacts associated with either webapp or standalone development. This feature is similar to "scopes" in Maven but much more powerful.
Update: Dynamic revisions
When publishing the "projects" module, you might want to use dynamic revisions to simplify maintenance.
<ivy-module version="2.0">
<info organisation="my.org.name" module="projects"/>
<dependencies>
<dependency org="my.org.name" name="projectA" rev="latest.release"/>
<dependency org="my.org.name" name="projectB" rev="latest.release"/>
<dependency org="my.org.name" name="projectC" rev="latest.release"/>
..
..
</dependencies>
</ivy-module>
The publish task will generate and push an ivy file resolved with the latest version of each project.
You will still need to list each project, but this is in fact a good thing. It means pulling in older versions of the "projects" module will result in same number of revisions at a point in time.
Generate ivy file
Finally to completely automate this process, using a variable number projects, perhaps you could generate the "projects" ivy file?
The following is a groovy snippet that you could use:
<groovy>
import groovy.xml.MarkupBuilder
new File("build/ivy.xml").withWriter { writer ->
def xml = new MarkupBuilder(writer)
xml."ivy-module"(version:"2.0") {
info(organisation:"my.org.name", module:"projects")
dependencies() {
new File("/path/to/projects/directory").listFiles().each { dir ->
dependency(org:"my.org.name", name:dir.name, rev:"latest.release")
}
}
}
}
</groovy>