I'm not 100% sure and I don't have the time to check now (sorry) but I think Ivy will only check if an artifact has changed if the ivy file (or pom file in your situation) has changed. From the timestamps in your listing it seems that only the jar has been updated and that the pom has remained unchanged.
Could you try updating the pom as well to see if this solves your problem? In addition if I remember correctly, there is a bug in the chain resolver in combination with changingPatterns: if you specify a changingPattern on a child resolver, you must also specify it on the chain, otherwise Ivy won't consider the resolver as changing. So, a second option to try could be adding the changingPattern attribute to your chain resolver. A third possibility is to add changing="true" to your dependency, something like: <dependency org="com.foo" name="bar" rev="0.0.1-SNAPSHOT" changing="true"/> Maarten ________________________________ From: Jonathan Williams <[email protected]> To: [email protected] Sent: Wednesday, September 28, 2011 9:55 PM Subject: Ivy cache ignoring changingPattern on ibiblio resolver, not picking up latest SNAPSHOT artifact Hi, I'm trying to get Ivy to pick up the latest SNAPSHOT revision of an artifact from my local Maven repository. I've looked through the documentation and numerous examples online and followed the suggestions there, but I haven't had any luck so far. Ivy finds and downloads the SNAPSHOT artifact the first time without any issue and stores it in the cache. However, if that SNAPSHOT artifact is subsequently updated in my Maven repo, Ivy will not pick up the latest artifact. Here are the relevent parts of my ivysettings.xml <property name="ivy.resolver.default.check.modified" value="true"/> <resolvers> <chain name="default-chain" returnFirst="true"> <filesystem name="enterprise" m2compatible="true"> <ivy pattern="${enterprise.repo.dir}/[organisation]/[module]/ivy.xml"/> <artifact pattern="${enterprise.repo.dir}/[organisation]/[module]/[artifact].[ext]"/> </filesystem> <url name="shared" m2compatible="true" checksums=""> <ivy pattern="${shared.repo.dir}/[organisation]/[module]/[revision]/ivy.xml"/> <artifact pattern="${shared.repo.dir}/[organisation]/[module]/[revision]/[artifact]-[revision](-[type]).[ext]"/> </url> <ibiblio name="maven-local" m2compatible="true" root="${maven.cache.uri}" changingPattern=".*SNAPSHOT"/> </chain> </resolvers> Here are the contents of my local maven repo: -rw-r--r-- 1 jwilliam xxxxxx 2042390 Sep 28 15:17 ../../../../build/.cache/m2/com/foo/bar/0.0.1-SNAPSHOT/bar-0.0.1-SNAPSHOT.jar -rw-r--r-- 1 jwilliam xxxxxx 7817 Sep 23 12:01 ../../../../build/.cache/m2/com/foo/bar/0.0.1-SNAPSHOT/bar-0.0.1-SNAPSHOT.pom And my ivy cache, notice how the bar-0.0.1-SNAPSHOT artifact is no longer up to date (both size and timestamp different from the maven repo): ../../../../build/.cache/global/com.foo/bar: total 2028 drwxr-xr-x 2 jwilliam xxxxxx 4096 Sep 28 14:56 . drwxr-xr-x 20 jwilliam xxxxxx 4096 Sep 28 14:57 .. -rw-r--r-- 1 jwilliam xxxxxx 5925 Sep 23 12:01 ivy-0.0.1-SNAPSHOT.xml -rw-r--r-- 1 jwilliam xxxxxx 7817 Sep 23 12:01 ivy-0.0.1-SNAPSHOT.xml.original -rw-r--r-- 1 jwilliam xxxxxx 931 Sep 28 15:19 ivydata-0.0.1-SNAPSHOT.properties -rw-r--r-- 1 jwilliam xxxxxx 2042413 Sep 28 14:56 bar-0.0.1-SNAPSHOT-jar.jar My dependency on com.foo:bar is declared as such: <dependency org="com.foo" name="bar" rev="0.0.1-SNAPSHOT"/> Some of the things I've tried are tweaking the pattern I'm using in changingPattern, explicitly setting the 'pattern="[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"' and 'checkmodified="true"' fields. Nothing seems to work, short of deleting my Ivy cache and forcing a re-download of the artifact. Any ideas on what I'm doing that is different from all the examples I've looked at that ostensibly work? -Jonathan
