I tried to use extends tag to avoid boilerplate configurations like this
<ivy-module ...>
<info organisation="a" module="b">
<extends organisation="c" module="d" revision="1"
extendType="configurations"/>
</info>
<publications>
...
</publications>
<dependencies>
...
</dependencies>
</ivy-module>
The ivy.xml containing configurations is
<ivy-module ...>
<info organisation="c" module="d" revision="1" status="integration"
publication="..."/>
<configurations defaultconfmapping="*->@">
<conf name="provided" transitive="true" description="Required for
compilation, but provided by the container or JRE at runtime."/>
<conf name="compile" transitive="true" description="Required for
compilation"/>
<conf name="runtime" transitive="true" extends="compile" description
="Required at runtime"/>
<conf name="test" transitive="true" extends="runtime"
description="Required
for test only"/>
</configurations>
<publications>
<artifact name="d" type="pom" ext="pom" conf="compile"/>
</publications>
</ivy-module>
I generate corresponding pom and publish it with ivy.xml so that I can run
publish as usual and have something to resolve for.
The resulting ivy.xml that is published looks like this
<ivy-module ...>
<info organisation="a" module="b" revision="..." status="integration"
publication="...">
<!-- <extends organisation="c" module="d" revision="1"
extendType="configurations"/> -->
</info>
<configurations>
<!-- configurations inherited from c#d;1 -->
<conf name="provided" visibility="public" description="Required to
compile application, but provided by the container or JRE at runtime."/>
<conf name="compile" visibility="public" description="Required to
compile application"/>
<conf name="runtime" visibility="public" description="Required at
runtime" extends="compile"/>
<conf name="test" visibility="public" description="Required for
test only" extends="runtime"/>
</configurations>
<publications>
... </publications>
<dependencies> ...
</dependencies>
</ivy-module>
Please note the missing defaultconfmapping, which lets Ivy to revert to
default defaultconfmapping ("*->*") which has the effect of putting all
configurations together with all other configurations, making
configurations useless in resolve.
Is this a bug or am I missing something?
I noticed other effects of "extends" that are undocumented, like looking
for a "parent" ivy.xml on resolve in ".." (undocumented default value for
location attribute + location having preference over resolvers even when
not specified explicitly?) and treating the repository name where the
resolved ivy.xml used for extending was found as a resolver reference name
on retrieve and complaining that that name was not defined in Ivy settings.