Transitioning from Clearcase to Mercurial (A developer's account)
Chris Scott
Chris.Scott at mmodal.com
Thu Oct 13 12:56:21 UTC 2011
> Do packaging managers and/or artifact repositories have an easy way to
> handle versioning of these binaries?
>
> I would like to have a way to specify, in a file alongside my source
> files, the proper version of artifacts (graphic binaries,
> documentation, 3rd party object code, etc) and to have that
> relationship part of the source control. Do Ivy cfg files or Maven
> POMs provide this? What do you suggest I read up on?
Yes, this is exactly how it works in an Ivy descriptor. Here's an example dependency section:
<dependencies>
<dependency org="log4j" name="log4j" rev="1.2.14"/>
<dependency org="org.junit" name="junit" rev="4.4"/>
</dependencies>
The Ivy descriptor is a single xml file that gets controlled in VCS. The versions you specify are quite flexible. You can ask for a specific version (as in the aforementioned example), a minimum version (e.g. >= 3.1.0), or whatever the latest version is.
Furthermore it lets you decide what happens when transitive dependencies conflict. For example:
A->B->C
\_____|
That is, that C depends on B depends on A. C also depends on A directly. What happens when C asks for a B that has a different version of A that C itself asked for? Ivy provides conflict managers which can handle this situation intelligently.
The Ivy docs are quite good.
http://ant.apache.org/ivy/history/2.0.0/tutorial/start.html
Since the ivy.xml is controlled, when you update to an older version, the ivy.xml is in turn pointing to the artifacts at that version thereby still allowing full reproducibility at any point (assuming you don't use wildcard version specifiers).
~Chris
More information about the Mercurial
mailing list