ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Troy Self" <ts...@bbn.com>
Subject RE: What are publications in Ivy?
Date Sun, 28 Feb 2010 13:29:07 GMT
> -----Original Message-----
> From: HHB [mailto:hubaghdadi@yahoo.ca]
> Sent: Sunday, February 28, 2010 3:51 AM
> To: ivy-user@ant.apache.org
> Subject: What are publications in Ivy?


> I didn't understand what is Ivy publications.
> Building, packaging a project/library are Ant's tasks and are written
> in Ant
> build files.
> So, what are Ivy publications and for what are used?

You are correct that building and packaging are handled by Ant. Ivy is then
used to 'publish' the product of your build back to the Ivy repository. The
reason you want to do this is to allow Ivy to manage your own libraries the
same way it manages 3rd party libraries. If the library you are building is
the sole artifact of a system and nothing will ever depend on it, then you
may choose not to publish it. In my work, my team maintains a set of core
libraries that we then use on several projects for different customers. We
publish those core libraries back to our Ivy repository so that the
customer-based projects can depend on them appropriately and automatically
remain up-to-date.

> One more thing:
> What does this patterns attribute means?
> 
> <ivy:retrieve pattern="${ivy.lib.dir}/[conf]/[artifact]-
> [revision].[ext]"/>

It simply tells Ivy where you want to put dependencies when you retrieve
them and how you want them named. "Conf" will be replaced with the name of
the configuration for the artifact (e.g. jar, war, src, javadoc, etc).
"Artifact" gets replaced with the component name. "Revision" gets replaced
with the version number. "Ext" gets replaced with the proper extension of
the artifacts (e.g. jar). The ivy.lib.dir is just an ant variable that you
would set.

For example, if your ivy.xml file listed a single dependency on
commons-lang, version 1.1, then the retrieve task would put the commons-lang
jar file at: 
${ivy.lib.dir}/jar/commons-lang-1.1.jar .

All of this is described pretty well in the Ivy documentation at [1].

Hope this helps.

-- tBs

[1] http://ant.apache.org/ivy/history/latest-milestone/use/retrieve.html




Mime
View raw message