In ivysettings.xml I have the following resolver for the artifact:
<resolvers>
<url name="shared" m2compatible="true">
<artifact pattern="${ivy.shared.default.root}/[orgPath]/[module]/[revision]/[module]-[revision]-[conf].[ext]" />
</url>
</resolvers>
My ivy.xml file has two configurations and two publications:
<configurations>
<conf name="debug"/>
<conf name="release"/>
</configurations>
<publications>
<artifact name="project-debug" type="zip" conf="debug" ext="zip" />
<artifact name="project-release" type="zip" conf="release" ext="zip"/>
</publications>
In the build.xml I use ivy:publish:
<target name="publish" "description="--> publish the project in the ivy repository">
<property name="revision" value="${project.revision}"/>
<ivy:publish artifactspattern="${build.dir}/[artifact].[ext]"
resolver="shared"
pubrevision="${revision}"
/>
</target>
The filename of the published artifact is not what I would expect:
project-1.0-default.zip
I would expect two files:
project-1.0-release.zip
project-1.0-debug.zip
Please note that I cannot use the following pattern:
${ivy.shared.default.root}/[orgPath]/[module]/[revision]/[artifact]-[revision].[ext]
That's because the repository I have to use (Archiva) requires the artifact to be of the form [module]-[revision]-... Otherwise we get exceptions like this:
Not a valid artifact path in a Maven 2 repository, filename 'project-debug-1.0.zip' doesn't contain version '1.0'.