You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Gilles Scokart <gs...@gmail.com> on 2007/02/07 14:16:17 UTC

Why is my latest not the real latest



I have a continuous that build a project A . continuously.  The continuous
build publish the result to a share repository using a version pattern
build.XXXX.  From time to time, we make an official build and publish the
result to a release repository using a pattern 1.YY.

Now, I just realized that when we make a resolve of a project depending on A
using latest.integration, I obtain the version 1.YY instead of the build.XXX
version.

My resolvers are :

	<resolvers>
		<cache name="cache">
			<ivy
pattern="${ivy.cache.dir}/${ivy.cache.default.ivy.pattern}" />
      		<artifact
pattern="${ivy.cache.dir}/${ivy.cache.default.artifact.pattern}" />
		</cache>
		<filesystem name="local">
			<ivy
pattern="${ivy.local.dir}/${ivy.local.default.ivy.pattern}" />
      		<artifact
pattern="${ivy.local.dir}/${ivy.local.default.artifact.pattern}" />
    		</filesystem>
		<filesystem name="shared">
			<ivy
pattern="${ivy.share.dir}/${ivy.shared.default.ivy.pattern}" />
			<artifact
pattern="${ivy.share.dir}/${ivy.shared.default.artifact.pattern}" />
		</filesystem>
		<filesystem name="release">
			<ivy
pattern="${ivy.release.dir}/${ivy.shared.default.ivy.pattern}" />
			<artifact
pattern="${ivy.release.dir}/${ivy.shared.default.artifact.pattern}" />
		</filesystem>
		<chain name="remote" returnFirst="false">
      		<resolver ref="release"/>
      		<resolver ref="shared"/>
		</chain>
    		<chain name="offline" returnFirst="true">
      		<resolver ref="local"/>
			<resolver ref="cache"/>
    		</chain>    	
		<chain name="online" returnFirst="true">
      		<resolver ref="local"/>
			<resolver ref="remote"/>
	    	</chain>
	</resolvers>

To make my resolve I use the online resolver.  My local repository is empty,
but my cache is complete.

I use the latest strategy :

	<latest-strategies>
		<latest-revision name="local-revision">
			<specialMeaning name="build" value="-1"/>
			<specialMeaning name="dev" value="1"/> <!-- Dev
received the priority -->
		</latest-revision>
	</latest-strategies>

I also tried this : 

	<latest-strategies>
		<latest-revision name="local-revision">
			<specialMeaning name="build" value="100"/> <!--
Build received the priority over official build -->
			<specialMeaning name="dev" value="101"/> <!-- Dev
received the priority -->
		</latest-revision>
	</latest-strategies>

But it doesn't change anything.

Before I tried to clean my cache.  Do you think that in the first latest
strategy the version 1.YYYY will come before build.YYYY ?
Do you think that the problem that I have might be because of something
present in the cache?

Thanks,

Gilles



Re: Why is my latest not the real latest

Posted by Xavier Hanin <xa...@gmail.com>.
Hi Gilles,

Sorry for the delay, I'm currently working on a project where I don't have
any internet access. Hopefully it won't last after next week.

For your problem of version comparison the problem is that special meanings
are used only to compare to strings (comparing dev to build) during the
comparison of the parts of your revision.

But in your case the strategy will compare '1' to 'build', and consider the
number to be bigger than the string, whatever the string is. So if you don't
want/can change your revision policy, you will have to change your latest
strategy, maybe using a custom one will be the easier way to go.

- Xavier

On 2/7/07, Gilles Scokart <gs...@gmail.com> wrote:
>
>
>
>
> I have a continuous that build a project A . continuously.  The continuous
> build publish the result to a share repository using a version pattern
> build.XXXX.  From time to time, we make an official build and publish the
> result to a release repository using a pattern 1.YY.
>
> Now, I just realized that when we make a resolve of a project depending on
> A
> using latest.integration, I obtain the version 1.YY instead of the
> build.XXX
> version.
>
> My resolvers are :
>
>         <resolvers>
>                 <cache name="cache">
>                         <ivy
> pattern="${ivy.cache.dir}/${ivy.cache.default.ivy.pattern}" />
>                 <artifact
> pattern="${ivy.cache.dir}/${ivy.cache.default.artifact.pattern}" />
>                 </cache>
>                 <filesystem name="local">
>                         <ivy
> pattern="${ivy.local.dir}/${ivy.local.default.ivy.pattern}" />
>                 <artifact
> pattern="${ivy.local.dir}/${ivy.local.default.artifact.pattern}" />
>                 </filesystem>
>                 <filesystem name="shared">
>                         <ivy
> pattern="${ivy.share.dir}/${ivy.shared.default.ivy.pattern}" />
>                         <artifact
> pattern="${ivy.share.dir}/${ivy.shared.default.artifact.pattern}" />
>                 </filesystem>
>                 <filesystem name="release">
>                         <ivy
> pattern="${ivy.release.dir}/${ivy.shared.default.ivy.pattern}" />
>                         <artifact
> pattern="${ivy.release.dir}/${ivy.shared.default.artifact.pattern}" />
>                 </filesystem>
>                 <chain name="remote" returnFirst="false">
>                 <resolver ref="release"/>
>                 <resolver ref="shared"/>
>                 </chain>
>                 <chain name="offline" returnFirst="true">
>                 <resolver ref="local"/>
>                         <resolver ref="cache"/>
>                 </chain>
>                 <chain name="online" returnFirst="true">
>                 <resolver ref="local"/>
>                         <resolver ref="remote"/>
>                 </chain>
>         </resolvers>
>
> To make my resolve I use the online resolver.  My local repository is
> empty,
> but my cache is complete.
>
> I use the latest strategy :
>
>         <latest-strategies>
>                 <latest-revision name="local-revision">
>                         <specialMeaning name="build" value="-1"/>
>                         <specialMeaning name="dev" value="1"/> <!-- Dev
> received the priority -->
>                 </latest-revision>
>         </latest-strategies>
>
> I also tried this :
>
>         <latest-strategies>
>                 <latest-revision name="local-revision">
>                         <specialMeaning name="build" value="100"/> <!--
> Build received the priority over official build -->
>                         <specialMeaning name="dev" value="101"/> <!-- Dev
> received the priority -->
>                 </latest-revision>
>         </latest-strategies>
>
> But it doesn't change anything.
>
> Before I tried to clean my cache.  Do you think that in the first latest
> strategy the version 1.YYYY will come before build.YYYY ?
> Do you think that the problem that I have might be because of something
> present in the cache?
>
> Thanks,
>
> Gilles
>
>
>