The ivy:makepom task has been greatly enhanced in Ivy 2.2.0. It is now possible
to specify a custom pom template containing information about the license, SCM,
plugins, developers, ...
Here is how Ivy publishes itself to the Nexus repository.
<ivy:makepom ivyfile="${artifacts.build.dir}/ivy.xml"
pomfile="${m2.distrib.dir}/ivy-${build.version}.pom"
templatefile="${basedir}/src/etc/makepom/pom.template">
<mapping conf="core" scope="compile"/>
<mapping conf="test" scope="test"/>
</ivy:makepom>
<ivy:settings id="upload.settingsId" file="ivysettings-release.xml" />
<ivy:resolve file="${basedir}/build/artifact/ivy.xml"
transitive="false"
/>
<ivy:publish organisation="org.apache.ivy"
module="ivy"
revision="${build.version}"
srcivypattern="${basedir}/build/artifact/ivy.xml"
artifactspattern="${basedir}/build/distrib/maven2/[revision]/[artifact]-[revision](-[classifier]).[ext]"
publishivy="false"
conf="core"
settingsRef="upload.settingsId"
resolver="nexus">
<!-- The standard maven2 artifacts -->
<artifact name="ivy" ext="pom" type="ivy" />
<artifact name="ivy" ext="jar" type="sources" classifier="sources"
/>
<artifact name="ivy" ext="jar" type="javadoc" classifier="javadoc"
/>
</ivy:publish>
We declare some additional artifacts (like the generated pom and the
sources/javadocs) inside the ivy:publish task because the ivy.xml doesn't
contain them.
In addition, the ivysetting-release.xml configures Ivy to automatically create
a
PGP signature of the artifacts. So there is no need to declare them any longer
as artifact.
Maarten
----- Original Message ----
From: Jean-Louis Boudart <[email protected]>
To: Ant Developers List <[email protected]>
Sent: Fri, October 8, 2010 5:03:37 PM
Subject: Re: Review Needed for "Publishing Maven Artifacts with Ivy" Doc
At the beggining of the documentation you say "In addition you will need a
minimal POM for your jar".
Are you planning to maintain dependencies in both ivy.xml / pom.xml
manually?
Ivy offers a task that can generate a pom.xml from a given ivy.xml (
http://ant.apache.org/ivy/history/trunk/use/makepom.html). However the
support is quite limited and provided many limations.
I'll get back later with some additional informations on the limitations and
already possible alternatives.
Stay tuned :p
2010/10/8 Jean-Louis Boudart <[email protected]>
> Hi there,
>
> <ivy:deliver> is used to generate the ivy.xml before publication based on
> the last resolved informations.
>
> Why are we generating an ivy.xml here ?
> Because when publishing, ivy adds some attributes in the generated ivy.xml
> file (like publication date, publication revision, publication branch).
>
> One other goal of the <ivy:deliver> is to replace dynamic revisions in
> project dependencies (if you use latest.revision, or [2.2.+[ or stuff like
> that in your <dependencies>).
>
> To sum up <ivy:deliver> fixes every dynamic value in the ivy.xml file to
> make it reproducible.
>
> <ivy:publish> can make the <deliver> process if you haven't do it explictly
> before. So you can consider <ivy:deliver> as optionnal.
> In some cases, invoking explicitly <ivy:deliver> is required :
>
> - If you want to do some post processing on ivy.xml file before
> publishing
> - If you're using recursive delivery
>
> HTH
>
> 2010/10/8 Stefan Bodewig <[email protected]>
>
> Hi,
>>
>> I have one issue that is slowly bubbling up on my TODO list: I promised
>> to provide Ant+Ivy content for
>> <http://www.apache.org/dev/publishing-maven-artifacts.html>
>>
>> Rather than starting a lengthy thread on this list, I've created a Wiki
>> page <http://wiki.apache.org/ant/PublishingMavenArtifactsWithAntAndIvy>
>>
>> Please review what I've written, in particular the Ivy specific parts
>> since I'm really a newbie when it comes to Ivy. If anybody could
>> explain to me why we use the deliver task at all, I'd be grateful.
>>
>> Thanks
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
> --
> Jean Louis Boudart
> Independent consultant
> Project Lead http://www.easyant.org
>
--
Jean Louis Boudart
Independent consultant
Project Lead http://www.easyant.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]