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 "Sillence, Martin (GE Oil & Gas)" <Ma...@ge.com> on 2012/10/04 16:37:26 UTC

Getting snapshots only from the snapshot repo

Hi,

We are having a performance issue with ivy we are trying to download the
latest snapshots either from a local repo (not the ivy cache) or from a
remote repo
We also have an extensive list of fixed release libraries we link to
What I'd like to do is:
1/ for snapshots: search two locations for the latest file - local
repo/remote repo
2/ for release: just use any version - ivy cache/remote repo

The purpose of the local cache is so local builds will publish and pick
up our locally built artefacts in preference to the ones in the repo

The configuration we have is:
<resolvers>
...
		<chain name="resolver" checkmodified="true"
changingPattern=".*SNAPSHOT" returnFirst="false" latest="latest-time">
				<resolver ref="local.cache"/>
				<ibiblio name="snapshot"
m2compatible="true" usepoms="false" root="${snapshot.url}"
	
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[clas
sifier]).[ext]"/>

			<ibiblio name="release" m2compatible="true"
root="${release.url}"
	
pattern="[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
		</chain>
...

What actually happens is it searches all three for all files
I tried:
 		<chain name="resolver" returnFirst="true">
			<chain name="shapshot.resolver"
checkmodified="true" changingPattern=".*SNAPSHOT" returnFirst="false"
latest="latest-time">
				<resolver ref="local.cache"/>
				<ibiblio name="snapshot"
m2compatible="true" usepoms="false" root="${snapshot.url}"
	
pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[clas
sifier]).[ext]"/>
			</chain>

			<ibiblio name="release" m2compatible="true"
root="${release.url}"
	
pattern="[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
		</chain>

But the outer return first seems to override the inner one.

I guess I'm missing something obvious...

Thanks,
M

PS
We're using nexus as our repo
 local.cache is just a filesystem:
		<filesystem name="local.cache" m2compatible="true"
force="false">
			<artifact
pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[type
]s/[artifact]-[revision](-[classifier]).[ext]"/>
			<artifact
pattern="${ivy.default.ivy.user.dir}/local/[organisation]/[module]/[type
]s/[artifact]-[revision](-[classifier]).[ext]"/>
		</filesystem>