dynamic revision and determine the most recent

View: New views
10 Messages — Rating Filter:   Alert me  

dynamic revision and determine the most recent

by corwin.yo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I have a problem with Ivy to find the most recent artifacts between 2 repositories. I read this documentation :
http://ant.apache.org/ivy/history/latest-milestone/concept.html#change and the best practices, but I have this problem yet.

I tried many options (resolveDynamic, force) and this mailing :
http://www.nabble.com/Ivy-resolve-not-getting-latest-td25531231.html
but always without success.

My dependancies get the changing attribute in ivy.xml file.
My convention about latest.integration is like Maven with a SNAPSHOT pattern.
This my ivysettings.xml :

<ivysettings>

        <!-- <property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local" override="false" />-->
        <!-- <property name="ivy.local.default.ivy.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false" />-->
        <!-- <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false" />-->

        <credentials host="repo.masternaut.com" realm="Artifactory Realm" username="cruisecontrol" passwd="Pas7*!" />

        <settings defaultResolver="default" defaultConflictManager="all" />
        <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
        <resolvers>

                <!-- <filesystem name="local" checkmodified="true" changingPattern=".*">-->
                <!-- <ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />-->
                <!-- <artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />-->
                <!-- </filesystem>-->

                <url name="shared" m2compatible="true" checkmodified="true" changingPattern=".*">
                        <ivy pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/ivy-[revision].xml" />
                        <artifact pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
                </url>
                <url name="masternaut-repository-ext" m2compatible="true">
                        <artifact pattern="http://repo.masternaut.com/extlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
                </url>
                <ibiblio name="maven-public" m2compatible="true" />
                <chain name="default">
                        <resolver ref="local" />
                        <resolver ref="shared" />
                        <resolver ref="masternaut-repository-ext" />
                </chain>
        </resolvers>

</ivysettings>

Log with IvyIDE (which is more verbose that ant -v):

IVYDE: calling resolve on ivy.xml

:: resolving dependencies :: masternaut#com.masternaut.widgetsgwt;1.3
        confs: [default]
        validate = true
        refresh = false
resolving dependencies for configuration 'default'
== resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3 [default]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default
== resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3 [compile]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default
== resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3 [package]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default
== resolving dependencies masternaut#com.masternaut.widgetsgwt;1.3->masternaut#com.masternaut.commongwt;latest.integration [compile->dev]
loadData of masternaut#com.masternaut.commongwt;latest.integration of rootConf=default
        using default to resolve masternaut#com.masternaut.commongwt;latest.integration
default: Checking cache for: dependency: masternaut#com.masternaut.commongwt;latest.integration {compile=[dev]}
don't use cache for masternaut#com.masternaut.commongwt;latest.integration: changing=true
don't use cache for masternaut#com.masternaut.commongwt;latest.integration: changing=true
                tried /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/[revision]/ivys/ivy.xml
        listing all in /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/[revision]/ivys/ivy.xml
        using local to list all in /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/
                found 2 resources
        found revs: [1.1.7, 1.1.7.1]
        local: found md file for masternaut#com.masternaut.commongwt;latest.integration
                => /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/ivys/ivy.xml (1.1.7.1)
        parser = ivy parser
No entry is found in the ModuleDescriptorCache : /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
post 1.3 ivy file: using exact as default matcher
        found ivy file in cache for masternaut#com.masternaut.commongwt;1.1.7.1 (resolved by local): /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        default-cache: revision in cache (not updated): masternaut#com.masternaut.commongwt;1.1.7.1
        checking masternaut#com.masternaut.commongwt;1.1.7.1 from local against [none]
        module revision kept as first found: masternaut#com.masternaut.commongwt;1.1.7.1 from local
don't use cache for masternaut#com.masternaut.commongwt;latest.integration: checkModified=true
                tried http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/[revision]/ivy-[revision].xml
        listing all in http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/[revision]/ivy-[revision].xml
        using shared to list all in http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/
ApacheURLLister found URL=[http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7/].
ApacheURLLister found URL=[http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/].
                found 2 resources
        found revs: [1.1.7, 1.1.7.1]
        shared: found md file for masternaut#com.masternaut.commongwt;latest.integration
                => http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml (1.1.7.1)
        parser = ivy parser
Entry is found in the ModuleDescriptorCache : /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        found ivy file in cache for masternaut#com.masternaut.commongwt;1.1.7.1 (resolved by local): /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        default-cache: revision in cache is not up to date: masternaut#com.masternaut.commongwt;1.1.7.1
downloading http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml ...
        shared: downloading http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
                to /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml.original.part
sha1 file found for http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml: checking...
        shared: downloading http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml.sha1
                to /tmp/ivytmp9094608955675434442sha1
sha1 OK for http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
        [SUCCESSFUL ] masternaut#com.masternaut.commongwt;1.1.7.1!ivy.xml(ivy.original) (78ms)
post 1.3 ivy file: using exact as default matcher
        default-cache: parsed downloaded md file for masternaut#com.masternaut.commongwt;1.1.7.1; parsed=masternaut#com.masternaut.commongwt;1.1.7.1
masternaut#com.masternaut.commongwt;1.1.7.1 has changed: deleting old artifacts
deleting /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/jars/com.masternaut.commongwt-1.1.7.1.jar
                [1.1.7.1] masternaut#com.masternaut.commongwt
        checking masternaut#com.masternaut.commongwt;1.1.7.1 from shared against masternaut#com.masternaut.commongwt;1.1.7.1 from local
        module revision discarded as older: masternaut#com.masternaut.commongwt;1.1.7.1 from shared
don't use cache for masternaut#com.masternaut.commongwt;latest.integration: changing=true
                tried http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/[revision]/com.masternaut.commongwt-[revision].jar
        listing all in http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/[revision]/com.masternaut.commongwt-[revision].jar
        using masternaut-repository-ext to list all in http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
HTTP response status: 404 url=http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
CLIENT ERROR: Not Found url=http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
problem while listing resources in http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/ with masternaut-repository-ext:
  java.io.IOException The HTTP response code for http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/ did not indicate a success. See log for more detail.
        masternaut-repository-ext: unable to list resources for masternaut#com.masternaut.commongwt;latest.integration: pattern=http://repo.masternaut.com/extlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
        masternaut-repository-ext: no ivy file nor artifact found for masternaut#com.masternaut.commongwt;latest.integration
        found masternaut#com.masternaut.commongwt;1.1.7.1 in local
        [1.1.7.1] masternaut#com.masternaut.commongwt;latest.integration
== resolving dependencies masternaut#com.masternaut.commongwt;latest.integration->gwt#gwt-servlet;1.5.3 [dev->default]
loadData of gwt#gwt-servlet;1.5.3 of rootConf=default
        using default to resolve gwt#gwt-servlet;1.5.3
default: Checking cache for: dependency: gwt#gwt-servlet;1.5.3 {dev=[default]}
No entry is found in the ModuleDescriptorCache : /home/jbordeau/.ivy2/cache/gwt/gwt-servlet/ivy-1.5.3.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for gwt#gwt-servlet;1.5.3 (resolved by masternaut-repository-ext): /home/jbordeau/.ivy2/cache/gwt/gwt-servlet/ivy-1.5.3.xml
default: module revision found in cache: gwt#gwt-servlet;1.5.3
        found gwt#gwt-servlet;1.5.3 in masternaut-repository-ext
== resolving dependencies masternaut#com.masternaut.widgetsgwt;1.3->masternaut#com.masternaut.webraska.mapflyer;1.15.2 [compile->default]
loadData of masternaut#com.masternaut.webraska.mapflyer;1.15.2 of rootConf=default
        using default to resolve masternaut#com.masternaut.webraska.mapflyer;1.15.2
default: Checking cache for: dependency: masternaut#com.masternaut.webraska.mapflyer;1.15.2 {compile=[default]}
No entry is found in the ModuleDescriptorCache : /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.webraska.mapflyer/ivy-1.15.2.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for masternaut#com.masternaut.webraska.mapflyer;1.15.2 (resolved by shared): /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.webraska.mapflyer/ivy-1.15.2.xml
default: module revision found in cache: masternaut#com.masternaut.webraska.mapflyer;1.15.2
        found masternaut#com.masternaut.webraska.mapflyer;1.15.2 in shared
== resolving dependencies masternaut#com.masternaut.widgetsgwt;1.3->gwt#gwt-dnd;2.5.2 [compile->default]
loadData of gwt#gwt-dnd;2.5.2 of rootConf=default
        using default to resolve gwt#gwt-dnd;2.5.2
default: Checking cache for: dependency: gwt#gwt-dnd;2.5.2 {compile=[default]}
No entry is found in the ModuleDescriptorCache : /home/jbordeau/.ivy2/cache/gwt/gwt-dnd/ivy-2.5.2.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for gwt#gwt-dnd;2.5.2 (resolved by masternaut-repository-ext): /home/jbordeau/.ivy2/cache/gwt/gwt-dnd/ivy-2.5.2.xml
default: module revision found in cache: gwt#gwt-dnd;2.5.2
        found gwt#gwt-dnd;2.5.2 in masternaut-repository-ext
== resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3 [dev]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default
Nbr of module to sort : 4
Sort dependencies of : masternaut#com.masternaut.commongwt;1.1.7.1 / Number of dependencies = 1
Sort dependencies of : gwt#gwt-servlet;1.5.3 / Number of dependencies = 0
Sort done for : gwt#gwt-servlet;1.5.3
Sort done for : masternaut#com.masternaut.commongwt;1.1.7.1
Sort dependencies of : masternaut#com.masternaut.webraska.mapflyer;1.15.2 / Number of dependencies = 0
Sort done for : masternaut#com.masternaut.webraska.mapflyer;1.15.2
Sort dependencies of : gwt#gwt-dnd;2.5.2 / Number of dependencies = 0
Sort done for : gwt#gwt-dnd;2.5.2
Module descriptor is processed : gwt#gwt-servlet;1.5.3
        resolved ivy file produced in /home/jbordeau/.ivy2/cache/resolved-masternaut-com.masternaut.widgetsgwt-1.3.xml
:: downloading artifacts ::
         trying /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
                tried /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
downloading /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar ...
        local: downloading /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
                to /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/jars/com.masternaut.commongwt-1.1.7.1.jar.part
sha1 file found for /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar: checking...
        local: downloading /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar.sha1
                to /tmp/ivytmp2975758677642137941sha1
sha1 OK for /home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
        [SUCCESSFUL ] masternaut#com.masternaut.commongwt;1.1.7.1!com.masternaut.commongwt.jar (14ms)
        [NOT REQUIRED] masternaut#com.masternaut.webraska.mapflyer;1.15.2!com.masternaut.webraska.mapflyer.jar
        [NOT REQUIRED] gwt#gwt-dnd;2.5.2!gwt-dnd.jar
        [NOT REQUIRED] gwt#gwt-servlet;1.5.3!gwt-servlet.jar
:: resolution report :: resolve 240ms :: artifacts dl 15ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   4   |   1   |   0   |   0   ||   4   |   1   |
        ---------------------------------------------------------------------

In reading the log, if I understand, it determines correctly that the most recent from shared repository but it downloads from local. However the publication date of shared ivy-1.7.1.1.xml is most recent that this one of local.

There is wiered something is that if I change the order in my chain (shared before local) that works (it downloads from shared) and the problem is inversed (it does not take care the most recent from local). I have done test with returnFirst to false but without success.

Have got any ideas ?

RE: dynamic revision and determine the most recent

by Glidden, Douglass A :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ivy uses ONLY the revision numbers to compare versions across repositories-it does not use the "publication date" or any other metadata-it would be essentially meaningless, since there is no guarantee that any given server or your local computer has a correctly synchronized system clock.  If an artifact is found with the same revision in two different repositories, they are assumed to be the same and whatever repository is first in the chain will be used.  So in your case, Ivy finds that the most recent version in each repository is 1.1.7.1; since they are the same, it then proceeds to download from the first repository in the chain.  If two revisions are different they need to have different revision numbers.

Incidentally, the returnFirst property (which is false by default) has no relation to this-setting returnFirst to true causes Ivy to get the artifact from the first repository in which it finds a satisfactory version without checking to see if there are more recent versions in other repositories.

Doug Glidden
Software Engineer
The Boeing Company
Douglass.A.Glidden@...

-----Original Message-----
From: corwin.yo [mailto:corwin.yo@...]
Sent: Wednesday, October 21, 2009 09:18
To: ivy-user@...
Subject: dynamic revision and determine the most recent


Hello,

I have a problem with Ivy to find the most recent artifacts between 2 repositories. I read this documentation :
http://ant.apache.org/ivy/history/latest-milestone/concept.html#change and the best practices, but I have this problem yet.

I tried many options (resolveDynamic, force) and this mailing :
http://www.nabble.com/Ivy-resolve-not-getting-latest-td25531231.html
but always without success.

My dependancies get the changing attribute in ivy.xml file.
My convention about latest.integration is like Maven with a SNAPSHOT pattern.
This my ivysettings.xml :

<ivysettings>

        <!--    <property name="ivy.local.default.root"
value="${ivy.default.ivy.user.dir}/local" override="false" />-->
        <!--    <property name="ivy.local.default.ivy.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
override="false" />-->
        <!--    <property name="ivy.local.default.artifact.pattern"
value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]"
override="false" />-->

        <credentials host="repo.masternaut.com" realm="Artifactory Realm"
username="cruisecontrol" passwd="Pas7*!" />

        <settings defaultResolver="default" defaultConflictManager="all" />
        <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
        <resolvers>

                <!--            <filesystem name="local" checkmodified="true"
changingPattern=".*">-->
                <!--                    <ivy
pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />-->
                <!--                    <artifact
pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}"
/>-->
                <!--            </filesystem>-->

                <url name="shared" m2compatible="true" checkmodified="true"
changingPattern=".*">
                        <ivy
pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/ivy-[revision].xml"
/>
                        <artifact
pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
                </url>
                <url name="masternaut-repository-ext" m2compatible="true">
                        <artifact
pattern="http://repo.masternaut.com/extlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
/>
                </url>
                <ibiblio name="maven-public" m2compatible="true" />
                <chain name="default">
                        <resolver ref="local" />
                        <resolver ref="shared" />
                        <resolver ref="masternaut-repository-ext" />
                </chain>
        </resolvers>

</ivysettings>

Log with IvyIDE (which is more verbose that ant -v):

IVYDE: calling resolve on ivy.xml

:: resolving dependencies :: masternaut#com.masternaut.widgetsgwt;1.3
        confs: [default]
        validate = true
        refresh = false
resolving dependencies for configuration 'default'
== resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3
[default]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default == resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3
[compile]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default == resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3
[package]
loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default == resolving dependencies masternaut#com.masternaut.widgetsgwt;1.3->masternaut#com.masternaut.commongwt;latest.integration
[compile->dev]
loadData of masternaut#com.masternaut.commongwt;latest.integration of rootConf=default
        using default to resolve
masternaut#com.masternaut.commongwt;latest.integration
default: Checking cache for: dependency:
masternaut#com.masternaut.commongwt;latest.integration {compile=[dev]} don't use cache for masternaut#com.masternaut.commongwt;latest.integration:
changing=true
don't use cache for masternaut#com.masternaut.commongwt;latest.integration:
changing=true
                tried
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/[revision]/ivys/ivy.xml
        listing all in
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/[revision]/ivys/ivy.xml
        using local to list all in
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/
                found 2 resources
        found revs: [1.1.7, 1.1.7.1]
        local: found md file for
masternaut#com.masternaut.commongwt;latest.integration
                =>
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/ivys/ivy.xml
(1.1.7.1)
        parser = ivy parser
No entry is found in the ModuleDescriptorCache :
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
post 1.3 ivy file: using exact as default matcher
        found ivy file in cache for masternaut#com.masternaut.commongwt;1.1.7.1
(resolved by local):
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        default-cache: revision in cache (not updated):
masternaut#com.masternaut.commongwt;1.1.7.1
        checking masternaut#com.masternaut.commongwt;1.1.7.1 from local against [none]
        module revision kept as first found:
masternaut#com.masternaut.commongwt;1.1.7.1 from local don't use cache for masternaut#com.masternaut.commongwt;latest.integration:
checkModified=true
                tried
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/[revision]/ivy-[revision].xml
        listing all in
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/[revision]/ivy-[revision].xml
        using shared to list all in
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/
ApacheURLLister found
URL=[http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7/].
ApacheURLLister found
URL=[http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/].
                found 2 resources
        found revs: [1.1.7, 1.1.7.1]
        shared: found md file for
masternaut#com.masternaut.commongwt;latest.integration
                =>
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
(1.1.7.1)
        parser = ivy parser
Entry is found in the ModuleDescriptorCache :
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        found ivy file in cache for masternaut#com.masternaut.commongwt;1.1.7.1
(resolved by local):
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml
        default-cache: revision in cache is not up to date:
masternaut#com.masternaut.commongwt;1.1.7.1
downloading
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
...
        shared: downloading
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
                to
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/ivy-1.1.7.1.xml.original.part
sha1 file found for
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml:
checking...
        shared: downloading
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml.sha1
                to /tmp/ivytmp9094608955675434442sha1
sha1 OK for
http://repo.masternaut.com/intlibs/masternaut/com.masternaut.commongwt/1.1.7.1/ivy-1.1.7.1.xml
        [SUCCESSFUL ]
masternaut#com.masternaut.commongwt;1.1.7.1!ivy.xml(ivy.original) (78ms) post 1.3 ivy file: using exact as default matcher
        default-cache: parsed downloaded md file for masternaut#com.masternaut.commongwt;1.1.7.1;
parsed=masternaut#com.masternaut.commongwt;1.1.7.1
masternaut#com.masternaut.commongwt;1.1.7.1 has changed: deleting old artifacts deleting /home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/jars/com.masternaut.commongwt-1.1.7.1.jar
                [1.1.7.1] masternaut#com.masternaut.commongwt
        checking masternaut#com.masternaut.commongwt;1.1.7.1 from shared against
masternaut#com.masternaut.commongwt;1.1.7.1 from local
        module revision discarded as older:
masternaut#com.masternaut.commongwt;1.1.7.1 from shared don't use cache for masternaut#com.masternaut.commongwt;latest.integration:
changing=true
                tried
http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/[revision]/com.masternaut.commongwt-[revision].jar
        listing all in
http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/[revision]/com.masternaut.commongwt-[revision].jar
        using masternaut-repository-ext to list all in http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
HTTP response status: 404
url=http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
CLIENT ERROR: Not Found
url=http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/
problem while listing resources in
http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/ with
masternaut-repository-ext:
  java.io.IOException The HTTP response code for http://repo.masternaut.com/extlibs/masternaut/com.masternaut.commongwt/ did not indicate a success. See log for more detail.
        masternaut-repository-ext: unable to list resources for
masternaut#com.masternaut.commongwt;latest.integration:
pattern=http://repo.masternaut.com/extlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
        masternaut-repository-ext: no ivy file nor artifact found for masternaut#com.masternaut.commongwt;latest.integration
        found masternaut#com.masternaut.commongwt;1.1.7.1 in local
        [1.1.7.1] masternaut#com.masternaut.commongwt;latest.integration
== resolving dependencies
masternaut#com.masternaut.commongwt;latest.integration->gwt#gwt-servlet;1.5.3
[dev->default]
loadData of gwt#gwt-servlet;1.5.3 of rootConf=default
        using default to resolve gwt#gwt-servlet;1.5.3
default: Checking cache for: dependency: gwt#gwt-servlet;1.5.3 {dev=[default]} No entry is found in the ModuleDescriptorCache :
/home/jbordeau/.ivy2/cache/gwt/gwt-servlet/ivy-1.5.3.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for gwt#gwt-servlet;1.5.3 (resolved by
masternaut-repository-ext):
/home/jbordeau/.ivy2/cache/gwt/gwt-servlet/ivy-1.5.3.xml
default: module revision found in cache: gwt#gwt-servlet;1.5.3
        found gwt#gwt-servlet;1.5.3 in masternaut-repository-ext == resolving dependencies
masternaut#com.masternaut.widgetsgwt;1.3->masternaut#com.masternaut.webraska.mapflyer;1.15.2
[compile->default]
loadData of masternaut#com.masternaut.webraska.mapflyer;1.15.2 of rootConf=default
        using default to resolve masternaut#com.masternaut.webraska.mapflyer;1.15.2
default: Checking cache for: dependency:
masternaut#com.masternaut.webraska.mapflyer;1.15.2 {compile=[default]} No entry is found in the ModuleDescriptorCache :
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.webraska.mapflyer/ivy-1.15.2.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for
masternaut#com.masternaut.webraska.mapflyer;1.15.2 (resolved by shared):
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.webraska.mapflyer/ivy-1.15.2.xml
default: module revision found in cache:
masternaut#com.masternaut.webraska.mapflyer;1.15.2
        found masternaut#com.masternaut.webraska.mapflyer;1.15.2 in shared == resolving dependencies
masternaut#com.masternaut.widgetsgwt;1.3->gwt#gwt-dnd;2.5.2
[compile->default]
loadData of gwt#gwt-dnd;2.5.2 of rootConf=default
        using default to resolve gwt#gwt-dnd;2.5.2
default: Checking cache for: dependency: gwt#gwt-dnd;2.5.2 {compile=[default]} No entry is found in the ModuleDescriptorCache :
/home/jbordeau/.ivy2/cache/gwt/gwt-dnd/ivy-2.5.2.xml
pre 1.3 ivy file: using exactOrRegexp as default matcher
        found ivy file in cache for gwt#gwt-dnd;2.5.2 (resolved by
masternaut-repository-ext):
/home/jbordeau/.ivy2/cache/gwt/gwt-dnd/ivy-2.5.2.xml
default: module revision found in cache: gwt#gwt-dnd;2.5.2
        found gwt#gwt-dnd;2.5.2 in masternaut-repository-ext == resolving dependencies for masternaut#com.masternaut.widgetsgwt;1.3 [dev] loadData of masternaut#com.masternaut.widgetsgwt;1.3 of rootConf=default Nbr of module to sort : 4 Sort dependencies of : masternaut#com.masternaut.commongwt;1.1.7.1 / Number of dependencies = 1 Sort dependencies of : gwt#gwt-servlet;1.5.3 / Number of dependencies = 0 Sort done for : gwt#gwt-servlet;1.5.3 Sort done for : masternaut#com.masternaut.commongwt;1.1.7.1
Sort dependencies of : masternaut#com.masternaut.webraska.mapflyer;1.15.2 / Number of dependencies = 0 Sort done for : masternaut#com.masternaut.webraska.mapflyer;1.15.2
Sort dependencies of : gwt#gwt-dnd;2.5.2 / Number of dependencies = 0 Sort done for : gwt#gwt-dnd;2.5.2 Module descriptor is processed : gwt#gwt-servlet;1.5.3
        resolved ivy file produced in
/home/jbordeau/.ivy2/cache/resolved-masternaut-com.masternaut.widgetsgwt-1.3.xml
:: downloading artifacts ::
         trying
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
                tried
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
downloading
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
...
        local: downloading
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
                to
/home/jbordeau/.ivy2/cache/masternaut/com.masternaut.commongwt/jars/com.masternaut.commongwt-1.1.7.1.jar.part
sha1 file found for
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar:
checking...
        local: downloading
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar.sha1
                to /tmp/ivytmp2975758677642137941sha1
sha1 OK for
/home/jbordeau/.ivy2/local/masternaut/com.masternaut.commongwt/1.1.7.1/jars/com.masternaut.commongwt.jar
        [SUCCESSFUL ]
masternaut#com.masternaut.commongwt;1.1.7.1!com.masternaut.commongwt.jar
(14ms)
        [NOT REQUIRED]
masternaut#com.masternaut.webraska.mapflyer;1.15.2!com.masternaut.webraska.mapflyer.jar
        [NOT REQUIRED] gwt#gwt-dnd;2.5.2!gwt-dnd.jar
        [NOT REQUIRED] gwt#gwt-servlet;1.5.3!gwt-servlet.jar
:: resolution report :: resolve 240ms :: artifacts dl 15ms
        ---------------------------------------------------------------------
        |                  |            modules            ||   artifacts   |
        |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
        ---------------------------------------------------------------------
        |      default     |   4   |   1   |   0   |   0   ||   4   |   1   |
        ---------------------------------------------------------------------

In reading the log, if I understand, it determines correctly that the most recent from shared repository but it downloads from local. However the publication date of shared ivy-1.7.1.1.xml is most recent that this one of local.

There is wiered something is that if I change the order in my chain (shared before local) that works (it downloads from shared) and the problem is inversed (it does not take care the most recent from local). I have done test with returnFirst to false but without success.

Have got any ideas ?
--
View this message in context: http://www.nabble.com/dynamic-revision-and-determine-the-most-recent-tp25992333p25992333.html
Sent from the ivy-user mailing list archive at Nabble.com.


Re: dynamic revision and determine the most recent

by Niklas Matthies-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed 2009-10-21 at 08:40h, Glidden, Douglass A wrote on ivy-user:
> Ivy uses ONLY the revision numbers to compare versions across
> repositories-it does not use the "publication date" or any other
> metadata

Um, doesn't the latest-time strategy do exactly that (using the file time)?
(http://ant.apache.org/ivy/history/latest-milestone/concept.html#latest)

> -it would be essentially meaningless, since there is no
> guarantee that any given server or your local computer has a
> correctly synchronized system clock.  If an artifact is found with
> the same revision in two different repositories, they are assumed to
> be the same and whatever repository is first in the chain will be
> used.  So in your case, Ivy finds that the most recent version in
> each repository is 1.1.7.1; since they are the same, it then
> proceeds to download from the first repository in the chain.  If two
> revisions are different they need to have different revision
> numbers.

-- Niklas Matthies

Re: dynamic revision and determine the most recent

by Gilles Sadowski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi.

> Ivy uses ONLY the revision numbers to compare versions across repositories-
> it does not use the "publication date" or any other metadata- [...]

It seems to be the first answer to an issue several people are having: The
cache is not updated with more recent "SNAPSHOT" versions.

So is there any way to make ivy take the date into account?  Or, in other
words, how can "SNAPSHOT" revision be actually used (without always
resorting to a "cleancache")?

Best regards,
Gilles

RE: dynamic revision and determine the most recent

by corwin.yo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Douglass,

I understand how its working. But in this case, what is the best practice ?

If we imagine this case :
Module B depends of Module A (A->B)

2009-10-01 : the developper D1 commits and publishes to its local a modification on 1.2.0-SNAPSHOT version of module A.
2009-10-20 : a developper D2 commits another modification on 1.2.0-SNAPSHOT of module A and a continue integration system publishes to a shared repository. This modification occurs a new dependancy with module B.
2009-10-21 : developpeur D1 updates the Module B and  Ivy downloads the lastest.integration Module A from the local. Thereforce Module B does not compile, because it is older.

Has to update Module A and publish the last changes in its local, Developper D1 ?
or is there a better pratice ?

Glidden, Douglass A wrote:
Ivy uses ONLY the revision numbers to compare versions across repositories-it does not use the "publication date" or any other metadata-it would be essentially meaningless, since there is no guarantee that any given server or your local computer has a correctly synchronized system clock.  If an artifact is found with the same revision in two different repositories, they are assumed to be the same and whatever repository is first in the chain will be used.  So in your case, Ivy finds that the most recent version in each repository is 1.1.7.1; since they are the same, it then proceeds to download from the first repository in the chain.  If two revisions are different they need to have different revision numbers.

Incidentally, the returnFirst property (which is false by default) has no relation to this-setting returnFirst to true causes Ivy to get the artifact from the first repository in which it finds a satisfactory version without checking to see if there are more recent versions in other repositories.

Doug Glidden
Software Engineer
The Boeing Company
Douglass.A.Glidden@boeing.com

RE: dynamic revision and determine the most recent

by Glidden, Douglass A :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good point Niklas.  However, I would say that this is unreliable at best when used across repositories; it would probably be okay if all publishing to any of the repositories was always done from the CI server, for instance, so that the publication date is more or less guaranteed to be consistent, but when dealing with local repositories as most people have been doing, this is not the case.

However, if your developers' machines and servers are all synched to a time server then you should be fine using the latest-time strategy.

Doug Glidden
(703) 317-7523
http://dougglidden.blog.boeing.com

-----Original Message-----
From: Niklas Matthies [mailto:ml_ivy-user@...]
Sent: Wednesday, October 21, 2009 10:11
To: ivy-user@...
Subject: Re: dynamic revision and determine the most recent

On Wed 2009-10-21 at 08:40h, Glidden, Douglass A wrote on ivy-user:
> Ivy uses ONLY the revision numbers to compare versions across
> repositories-it does not use the "publication date" or any other
> metadata

Um, doesn't the latest-time strategy do exactly that (using the file time)?
(http://ant.apache.org/ivy/history/latest-milestone/concept.html#latest)

> -it would be essentially meaningless, since there is no guarantee that
> any given server or your local computer has a correctly synchronized
> system clock.  If an artifact is found with the same revision in two
> different repositories, they are assumed to be the same and whatever
> repository is first in the chain will be used.  So in your case, Ivy
> finds that the most recent version in each repository is 1.1.7.1;
> since they are the same, it then proceeds to download from the first
> repository in the chain.  If two revisions are different they need to
> have different revision numbers.

-- Niklas Matthies

RE: dynamic revision and determine the most recent

by carltonb :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> -----Original Message-----
> From: corwin.yo [mailto:corwin.yo@...]
> Sent: Wednesday, October 21, 2009 10:16 AM
> To: ivy-user@...
> 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.

Re: dynamic revision and determine the most recent

by Niklas Matthies-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed 2009-10-21 at 16:34h, Gilles Sadowski wrote on ivy-user:
:
> So is there any way to make ivy take the date into account?  Or, in other
> words, how can "SNAPSHOT" revision be actually used (without always
> resorting to a "cleancache")?

See here:
http://www.mail-archive.com/ivy-user@.../msg01752.html

-- Niklas Matthies

RE: dynamic revision and determine the most recent

by Glidden, Douglass A :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm confused-doesn't a SNAPSHOT revision get converted to a timestamp on publish?  I have never used SNAPSHOT versioning, so perhaps my understanding is incorrect.

In this scenario, I think it's pretty likely that D1's version of Module B will fail to compile regardless of which version of Module A gets downloaded-it will not compile using the version from the local repository because D2's changes are missing, and most likely it will not compile using the version from the shared repository because D1's changes are missing.  If it does happen to compile anyway (because D1 hasn't made any changes in Module B that rely on his own changes in Module A), that could be a significantly worse problem, because D1 may not realize that his changes from Module A have not been incorporated.  The bottom line is, anytime two developers make simultaneous changes, one of them is going to have to merge the changes and republish at some point in time; it's just a matter of how soon it has to be done.

However, as Niklas has correctly pointed out, you should be able (with a few caveats) to get what you're looking for by using the "latest-time" latest strategy instead of the default latest strategy ("latest-revision").

(As an aside, my personal opinion is that if you have a developer sitting with uncommitted changes on his local machine for 20 days, your team has bigger things to worry about than not getting the right version of a snapshot; that's just my opinion, though, and may or may not be relevant.)

Doug Glidden
Software Engineer
The Boeing Company
Douglass.A.Glidden@...

-----Original Message-----
From: corwin.yo [mailto:corwin.yo@...]
Sent: Wednesday, October 21, 2009 10:16
To: ivy-user@...
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 ?

If we imagine this case :
Module B depends of Module A (A->B)

2009-10-01 : the developper D1 commits and publishes to its local a modification on 1.2.0-SNAPSHOT version of module A.
2009-10-20 : a developper D2 commits another modification on 1.2.0-SNAPSHOT of module A and a continue integration system publishes to a shared repository. This modification occurs a new dependancy with module B.
2009-10-21 : developpeur D1 updates the Module B and  Ivy downloads the lastest.integration Module A from the local. Thereforce Module B does not compile, because it is older.

Has to update Module A and publish the last changes in its local, Developper
D1 ?
or is there a better pratice ?


Glidden, Douglass A wrote:

>
> Ivy uses ONLY the revision numbers to compare versions across
> repositories-it does not use the "publication date" or any other
> metadata-it would be essentially meaningless, since there is no
> guarantee that any given server or your local computer has a correctly
> synchronized system clock.  If an artifact is found with the same
> revision in two different repositories, they are assumed to be the
> same and whatever repository is first in the chain will be used.  So
> in your case, Ivy finds that the most recent version in each
> repository is 1.1.7.1; since they are the same, it then proceeds to
> download from the first repository in the chain.  If two revisions are
> different they need to have different revision numbers.
>
> Incidentally, the returnFirst property (which is false by default) has
> no relation to this-setting returnFirst to true causes Ivy to get the
> artifact from the first repository in which it finds a satisfactory
> version without checking to see if there are more recent versions in
> other repositories.
>
> Doug Glidden
> Software Engineer
> The Boeing Company
> Douglass.A.Glidden@...
>
>

--
View this message in context: http://www.nabble.com/dynamic-revision-and-determine-the-most-recent-tp25992333p25993396.html
Sent from the ivy-user mailing list archive at Nabble.com.


RE: dynamic revision and determine the most recent

by corwin.yo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks for all your answers.

My problem is resolved thanks to you.

This is my new config :

        <settings defaultResolver="default" defaultConflictManager="all" />
        <include url="${ivy.default.settings.dir}/ivysettings-local.xml" />
        <resolvers>

                <!-- <filesystem name="local" checkmodified="true" changingPattern=".*">-->
                <!-- <ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />-->
                <!-- <artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />-->
                <!-- </filesystem>-->

                <url name="shared" m2compatible="true" latest="latest-time" checkmodified="true" changingPattern=".*masternaut.*">
                        <ivy pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/ivy-[revision].xml" />
                        <artifact pattern="http://repo.masternaut.com/intlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
                </url>
                <url name="masternaut-repository-ext" m2compatible="true">
                        <artifact pattern="http://repo.masternaut.com/extlibs/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
                </url>
                <ibiblio name="maven-public" m2compatible="true" />
                <chain name="default" latest="latest-time" checkmodified="true" changingPattern=".*masternaut.*">
                        <resolver ref="local" />
                        <resolver ref="shared" />
                        <resolver ref="masternaut-repository-ext" />
                </chain>
        </resolvers>

Moreaver, the SNAPSHOT jars must contains the changing="true" attribute in ivy.xml.

Glidden, Douglass A wrote:
I'm confused-doesn't a SNAPSHOT revision get converted to a timestamp on publish?  I have never used SNAPSHOT versioning, so perhaps my understanding is incorrect.

In this scenario, I think it's pretty likely that D1's version of Module B will fail to compile regardless of which version of Module A gets downloaded-it will not compile using the version from the local repository because D2's changes are missing, and most likely it will not compile using the version from the shared repository because D1's changes are missing.  If it does happen to compile anyway (because D1 hasn't made any changes in Module B that rely on his own changes in Module A), that could be a significantly worse problem, because D1 may not realize that his changes from Module A have not been incorporated.  The bottom line is, anytime two developers make simultaneous changes, one of them is going to have to merge the changes and republish at some point in time; it's just a matter of how soon it has to be done.

However, as Niklas has correctly pointed out, you should be able (with a few caveats) to get what you're looking for by using the "latest-time" latest strategy instead of the default latest strategy ("latest-revision").

(As an aside, my personal opinion is that if you have a developer sitting with uncommitted changes on his local machine for 20 days, your team has bigger things to worry about than not getting the right version of a snapshot; that's just my opinion, though, and may or may not be relevant.)

Doug Glidden
Software Engineer
The Boeing Company
Douglass.A.Glidden@boeing.com

-----Original Message-----
From: corwin.yo [mailto:corwin.yo@infonie.fr]
Sent: Wednesday, October 21, 2009 10:16
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 ?

If we imagine this case :
Module B depends of Module A (A->B)

2009-10-01 : the developper D1 commits and publishes to its local a modification on 1.2.0-SNAPSHOT version of module A.
2009-10-20 : a developper D2 commits another modification on 1.2.0-SNAPSHOT of module A and a continue integration system publishes to a shared repository. This modification occurs a new dependancy with module B.
2009-10-21 : developpeur D1 updates the Module B and  Ivy downloads the lastest.integration Module A from the local. Thereforce Module B does not compile, because it is older.

Has to update Module A and publish the last changes in its local, Developper
D1 ?
or is there a better pratice ?


Glidden, Douglass A wrote:
>
> Ivy uses ONLY the revision numbers to compare versions across
> repositories-it does not use the "publication date" or any other
> metadata-it would be essentially meaningless, since there is no
> guarantee that any given server or your local computer has a correctly
> synchronized system clock.  If an artifact is found with the same
> revision in two different repositories, they are assumed to be the
> same and whatever repository is first in the chain will be used.  So
> in your case, Ivy finds that the most recent version in each
> repository is 1.1.7.1; since they are the same, it then proceeds to
> download from the first repository in the chain.  If two revisions are
> different they need to have different revision numbers.
>
> Incidentally, the returnFirst property (which is false by default) has
> no relation to this-setting returnFirst to true causes Ivy to get the
> artifact from the first repository in which it finds a satisfactory
> version without checking to see if there are more recent versions in
> other repositories.
>
> Doug Glidden
> Software Engineer
> The Boeing Company
> Douglass.A.Glidden@boeing.com
>
>

--
View this message in context: http://www.nabble.com/dynamic-revision-and-determine-the-most-recent-tp25992333p25993396.html
Sent from the ivy-user mailing list archive at Nabble.com.