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 Sadowski <gi...@harfang.homelinux.org> on 2009/05/07 16:48:52 UTC

Changing revision does not update the cache

Hello.

Considering this excerpt of the ivy file for module "B":

    <dependency name="A"
                rev="SNAPSHOT"
                changing="true"/>
 
Module "A" is "publish"-ed to a (local "filesystem") repository.
But when I "resolve", the cache is not updated with the latest version of
the repository. Consequently, after a "retrieve" the classpath of "B" still
contains an old version of "A"!

The documentation seems to imply that all that's needed is the "changing"
attribute, but this is not the case.
What am I missing from the config (ivy file and/or ivy settings)?

Best regards,
Gilles

Re: Changing revision does not update the cache

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
> Did you change the pattern to use a hyphen '-' instead of the underscore '_'
> that I have?

Yes ;-) and I also tried  ".*-SNAPSHOT.*" for good measure, to no avail.

Best,
Gilles

Re: Changing revision does not update the cache

Posted by Joshua Tharp <jo...@alumni.calpoly.edu>.
Did you change the pattern to use a hyphen '-' instead of the underscore '_'
that I have?

On Tue, May 12, 2009 at 7:24 AM, Gilles Sadowski <
gilles@harfang.homelinux.org> wrote:

> Hi.
>
> > This is what I have for my resolver
> >     <filesystem
> >         name="local"
> >         checkmodified="true"
> >         changingMatcher="regexp"
> >         changingPattern=".*_SNAPSHOT">
> >       <ivy pattern="${ivy.local.default.root}/${repo.ivy.pat}" />
> >       <artifact pattern="${ivy.local.default.root}/${repo.artifact.pat}"
> />
> >     </filesystem>
> >
> > While it shouldn't matter, you might try using the attribute
> "checkmodified"
> > instead of "checkModified" and see if that fixes your parse error.
>
> Indeed the documentation says "checkModified" but only "checkmodified"
> avoids the "ParseException"!
>
> As for retrieving the newest version, those 3 additional attributes don't
> change anything :-(
>
>
> Thanks for your reply anyway.
> Gilles
>
> P.S. I've just tried this with the latest jar from here:
>
> http://hudson.zones.apache.org/hudson/view/Ant/job/Ivy/lastSuccessfulBuild/artifact/trunk/build/artifact/org.apache.ivy_2.2.0.20090420130255.jar
>

Re: Changing revision does not update the cache

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
Hi.

> This is what I have for my resolver
>     <filesystem
>         name="local"
>         checkmodified="true"
>         changingMatcher="regexp"
>         changingPattern=".*_SNAPSHOT">
>       <ivy pattern="${ivy.local.default.root}/${repo.ivy.pat}" />
>       <artifact pattern="${ivy.local.default.root}/${repo.artifact.pat}" />
>     </filesystem>
> 
> While it shouldn't matter, you might try using the attribute "checkmodified"
> instead of "checkModified" and see if that fixes your parse error.

Indeed the documentation says "checkModified" but only "checkmodified"
avoids the "ParseException"!

As for retrieving the newest version, those 3 additional attributes don't
change anything :-(


Thanks for your reply anyway.
Gilles

P.S. I've just tried this with the latest jar from here:
http://hudson.zones.apache.org/hudson/view/Ant/job/Ivy/lastSuccessfulBuild/artifact/trunk/build/artifact/org.apache.ivy_2.2.0.20090420130255.jar

Re: Changing revision does not update the cache

Posted by Joshua Tharp <jo...@alumni.calpoly.edu>.
This is what I have for my resolver
    <filesystem
        name="local"
        checkmodified="true"
        changingMatcher="regexp"
        changingPattern=".*_SNAPSHOT">
      <ivy pattern="${ivy.local.default.root}/${repo.ivy.pat}" />
      <artifact pattern="${ivy.local.default.root}/${repo.artifact.pat}" />
    </filesystem>

While it shouldn't matter, you might try using the attribute "checkmodified"
instead of "checkModified" and see if that fixes your parse error.

On Tue, May 12, 2009 at 4:45 AM, Gilles Sadowski <
gilles@harfang.homelinux.org> wrote:

> Hi.
>
> No much reaction to that post:
>
> > Considering this excerpt of the ivy file for module "B":
> >
> >     <dependency name="A"
> >                 rev="SNAPSHOT"
> >                 changing="true"/>
> >
> > Module "A" is "publish"-ed to a (local "filesystem") repository.
> > But when I "resolve", the cache is not updated with the latest version of
> > the repository. Consequently, after a "retrieve" the classpath of "B"
> still
> > contains an old version of "A"!
> >
> > The documentation seems to imply that all that's needed is the "changing"
> > attribute, but this is not the case.
> > What am I missing from the config (ivy file and/or ivy settings)?
>
> To be more specific, the documentation says:
>
> <quote>
>  Ivy supports this kind of approach with the notion of changing revision. A
>  changing revision is just that: a revision for which Ivy should consider
>  that the artifacts may change over time. To handle this, you can either
>  specify a dependency as changing on the dependency tag, or use the
>  changingPattern and changingMatcher attributes on your resolvers to
> indicate
>  which revision or group of revisions should be considered as changing.
> </quote>
>
> Since this mentions an *alternative*, I used *one* of the possibilities,
> namely adding the "changing" attribute (see above).
> But the cache is *not* updated, as this shows:
> Repository:
> -rw-r--r-- 1 gilles gilles 159779 2009-05-11 15:15
> /home/dummy/ivy/repository/automatic/be.ac.ulb.iaa/gesss/jars/gesss-SNAPSHOT.jar
> Cache:
> -rw-r--r-- 1 gilles gilles 159782 2009-05-08 17:30
> /home/gilles/.ivy2/cache/be.ac.ulb.iaa/gesss/jars/gesss-SNAPSHOT.jar
>
> Can someone please confirm whether this is bug or expected behaviour?
> As far as I'm guessing correctly, it should be obvious that, for a changing
> revision, ivy should look up the repository to check whether a more recent
> version exit there...
> To make sure that an application will use the latest version stored in the
> repository, there must be another way than to clean the cache each time I
> run it!
>
>
> At the end of the explanation on "changing revisions", the doc indicates:
>
> <quote>
>  So if you want to use changing revisions, use the publish task to publish
>  your modules, it will take care of updating the publication date, and
>  everything will work fine. And remember to set checkModified=true" on your
>  resolver too!
> </quote>
>
> So, even as it clearly stated before that the "changing" attribute is all
> that's needed, I also tried to add the "checkModified" attribute on the
> resolver, but then I got the following error:
>
>  BUILD FAILED
>  /home/gilles/devel/SVN/java/ecl/ant/common.xml:188: impossible to
> configure
>  ivy:settings with given file:
> /home/dummy/ivy/settings/ivysettings-local.xml:
>  java.text.ParseException: failed to load settings from
>  file:/home/dummy/ivy/settings/ivysettings-local.xml: no set method found
> for
>  checkModified on class org.apache.ivy.plugins.resolver.FileSystemResolver
>
> I'm lost here. The error message is rather cryptic.
> It would really be useful to have a fully functional set of ivy files in
> the
> section "Cache and Change Management"...
>
>
> Regards,
> Gilles
>

Re: Changing revision does not update the cache

Posted by Gilles Sadowski <gi...@harfang.homelinux.org>.
Hi.

No much reaction to that post:

> Considering this excerpt of the ivy file for module "B":
> 
>     <dependency name="A"
>                 rev="SNAPSHOT"
>                 changing="true"/>
>  
> Module "A" is "publish"-ed to a (local "filesystem") repository.
> But when I "resolve", the cache is not updated with the latest version of
> the repository. Consequently, after a "retrieve" the classpath of "B" still
> contains an old version of "A"!
> 
> The documentation seems to imply that all that's needed is the "changing"
> attribute, but this is not the case.
> What am I missing from the config (ivy file and/or ivy settings)?

To be more specific, the documentation says:

<quote>
 Ivy supports this kind of approach with the notion of changing revision. A
 changing revision is just that: a revision for which Ivy should consider
 that the artifacts may change over time. To handle this, you can either
 specify a dependency as changing on the dependency tag, or use the
 changingPattern and changingMatcher attributes on your resolvers to indicate
 which revision or group of revisions should be considered as changing.
</quote>

Since this mentions an *alternative*, I used *one* of the possibilities,
namely adding the "changing" attribute (see above).
But the cache is *not* updated, as this shows:
Repository:
-rw-r--r-- 1 gilles gilles 159779 2009-05-11 15:15 /home/dummy/ivy/repository/automatic/be.ac.ulb.iaa/gesss/jars/gesss-SNAPSHOT.jar
Cache:
-rw-r--r-- 1 gilles gilles 159782 2009-05-08 17:30 /home/gilles/.ivy2/cache/be.ac.ulb.iaa/gesss/jars/gesss-SNAPSHOT.jar

Can someone please confirm whether this is bug or expected behaviour?
As far as I'm guessing correctly, it should be obvious that, for a changing
revision, ivy should look up the repository to check whether a more recent
version exit there...
To make sure that an application will use the latest version stored in the
repository, there must be another way than to clean the cache each time I
run it!


At the end of the explanation on "changing revisions", the doc indicates:

<quote>
 So if you want to use changing revisions, use the publish task to publish
 your modules, it will take care of updating the publication date, and
 everything will work fine. And remember to set checkModified=true" on your
 resolver too!
</quote>

So, even as it clearly stated before that the "changing" attribute is all
that's needed, I also tried to add the "checkModified" attribute on the
resolver, but then I got the following error:

 BUILD FAILED
 /home/gilles/devel/SVN/java/ecl/ant/common.xml:188: impossible to configure
 ivy:settings with given file: /home/dummy/ivy/settings/ivysettings-local.xml:
 java.text.ParseException: failed to load settings from
 file:/home/dummy/ivy/settings/ivysettings-local.xml: no set method found for
 checkModified on class org.apache.ivy.plugins.resolver.FileSystemResolver

I'm lost here. The error message is rather cryptic.
It would really be useful to have a fully functional set of ivy files in the
section "Cache and Change Management"...


Regards,
Gilles