ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlton Brown" <cbr...@silverpop.com>
Subject RE: dynamic revision and determine the most recent
Date Wed, 21 Oct 2009 14:25:13 GMT
> -----Original Message-----
> From: corwin.yo [mailto:corwin.yo@infonie.fr]
> Sent: Wednesday, October 21, 2009 10:16 AM
> To: ivy-user@ant.apache.org
> Subject: RE: dynamic revision and determine the most recent
> 
> 
> Thanks Douglass,
> 
> I understand how its working. But in this case, what is the best
> practice ?

The best practice, apparently, is not to have the same revision found in
multiple repositories in a chain.   Ivy does not seem to handle this
robustly.

If you really want to take this on, however, I have it working for a
trivial test case.   The key things to do are:
* Set checkmodified=true on the chain
* Set a latest-strategy of "latest-time" on the chain, and
"latest-revision" on the individual resolvers.   
* Set checkUpToDate=true on the <caches>
* Set the dependency revision to "latest.integration" which skips the
rev matching and devolves to the latest-strategy set on the resolver.

The latest-strategy of the chain is supposed to override those of the
child resolvers, but this only happens if the child resolver latest
strategies are set to a non-null value other than "default".    

Here's my working trivial configuration.  

<?xml version="1.0" encoding="UTF-8"?>
<ivysettings>
    <!-- properties in this section are defaults and can be overridden
from build scripts -->
	<property name="ivy.local.storage.root" value="${user.home}/ivy"
override="false"/>
	<property name="ivy.caches.root"
value="${ivy.local.storage.root}/caches"/>
	<property name="ivy.local.repo.root"
value="${ivy.local.storage.root}/repos"/>
	<property name="ivy.defaultcache.name" value="default"
override="false"/>
	<property name="ivy.defaultcache.dir"
value="${ivy.caches.root}/${ivy.defaultcache.name}" override="false"/>

	<property name="ivy.default.resolver" value="default-chain"
override="false"/>
	<settings defaultResolver="${ivy.default.resolver}"
override="false"/> 
    
    
   <caches checkUpToDate="true"
defaultCacheDir="${ivy.defaultcache.dir}"/>
   
	<resolvers>
		<filesystem name="mine" changingPattern=".*SNAPSHOT"
checkmodified="true" latest="latest-revision">
			<ivy
pattern="${ivy.local.repo.root}/local/[organisation]/[module]/[revision]
/ivy.xml" />
  			<artifact
pattern="${ivy.local.repo.root}/local/[organisation]/[module]/[revision]
/[artifact](-[classifier]).[ext]" />				
		</filesystem>
		
		<filesystem name="theirs" changingPattern=".*SNAPSHOT"
checkmodified="true" latest="latest-revision">
			<ivy
pattern="${ivy.local.repo.root}/local-shared/[organisation]/[module]/[re
vision]/ivy.xml" />
  			<artifact
pattern="${ivy.local.repo.root}/local-shared/[organisation]/[module]/[re
vision]/[artifact](-[classifier]).[ext]" />				
		</filesystem>
		
		<chain name="default-chain" changingPattern=".*SNAPSHOT"
checkmodified="true" latest="latest-time">
			<resolver ref="mine"/>
			<resolver ref="theirs"/>
		</chain>

	</resolvers>
</ivysettings>

Disclaimers:
* I haven't been able to get this working in the more complicated
production config
* There may be some unnecessary settings in here because I've ended up
throwing the whole kitchen sink at this problem and I'm almost ready to
give up.



***CONFIDENTIALITY NOTICE and DISCLAIMER*** 
This message and any attachment are confidential and may be
privileged or otherwise protected from disclosure and solely for
the use of the person(s) or entity to whom it is intended. If you
have received this message in error and are not the intended
recipient, please notify the sender immediately and delete this
message and any attachment from your system. If you are not the
intended recipient, be advised that any use of this message is
prohibited and may be unlawful, and you must not copy this
message or attachment or disclose the contents to any other person.

Mime
View raw message