Given:
<dependency org="foo" name="bar" />
and no configurations, following ant snippet:
<echo>${ivy.configuration}</echo>
<ivy:makepom ivyfile="${build.dir}/ivy.xml" pomfile="${build.dir}/${ivy.module}.pom">
<mapping conf="default" scope="compile" />
</ivy:makepom>
Produces pom with with optional dependency on foo.bar and prints "default".
If I change mapping to conf="*"
then it works but it is obviously suboptimal.
Is it possible to map unspecified default configuration or do I need to set conf="default" on all dependencies in ivy.xml ?
The optional dependency mapping appears to be the default behaviour.
Ivy is not restricted to a fixed number of scopes. While ivy configurations are much more flexible, you cannot assume that each configuration is being use to populate standard project classpaths....
The safest thing to do is provide an explicit mapping of each ivy configuration to the matching scope in Maven. In practice I recommend creating an ivy configuration to to emulate each Maven scope (regardless of whether it's used or not).
Note:
It seems that mapping "*" is harmless. Any other specific mappings will still take precedence.