You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Johan Stuyts (JIRA)" <ji...@apache.org> on 2007/01/12 17:45:27 UTC

[jira] Created: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
----------------------------------------------------------------------------------------------

                 Key: IVY-389
                 URL: https://issues.apache.org/jira/browse/IVY-389
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.4.1
            Reporter: Johan Stuyts
            Priority: Minor


With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.

The above happens when 'returnFirst' is set to 'true' on the chain of repositories.

Here is some example output from a build:
     local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
             tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
             tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
    CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
    CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
     hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
             tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
             tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
     hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
     found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Posted by "Johan Stuyts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Stuyts updated IVY-389:
-----------------------------

    Attachment: ivy-389.patch

The same patch with the changes to '.classpath' removed.

> Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
> ----------------------------------------------------------------------------------------------
>
>                 Key: IVY-389
>                 URL: https://issues.apache.org/jira/browse/IVY-389
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Johan Stuyts
>            Priority: Minor
>         Attachments: ivy-389.patch, ivy-389.patch
>
>
> With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.
> The above happens when 'returnFirst' is set to 'true' on the chain of repositories.
> Here is some example output from a build:
>      local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
>      found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xavier Hanin updated IVY-389:
-----------------------------

    Fix Version/s: 1.5

> Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
> ----------------------------------------------------------------------------------------------
>
>                 Key: IVY-389
>                 URL: https://issues.apache.org/jira/browse/IVY-389
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Johan Stuyts
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: ivy-389.patch, ivy-389.patch
>
>
> With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.
> The above happens when 'returnFirst' is set to 'true' on the chain of repositories.
> Here is some example output from a build:
>      local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
>      found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Posted by "Johan Stuyts (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/IVY-389?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Johan Stuyts updated IVY-389:
-----------------------------

    Attachment: ivy-389.patch

This patch fixes this issues assuming the assertions from my previous comment were correct.

WARNING: I had to fix one test, ChainResolverTest.testReturnFirstWithDefaultAndCacheAndRealResolver. This means that the changes are not fully backward compatible. Suppose you have resolvers A and B, and the dependency in the cache is from B. If the same dependency is added to A and you have 'returnFirst' set to 'true' on your chain resolver, you have to set 'checkmodified' to 'true' on your chain resolver. If you don't the dependency from B in the cache is used.


> Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
> ----------------------------------------------------------------------------------------------
>
>                 Key: IVY-389
>                 URL: https://issues.apache.org/jira/browse/IVY-389
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Johan Stuyts
>            Priority: Minor
>         Attachments: ivy-389.patch
>
>
> With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.
> The above happens when 'returnFirst' is set to 'true' on the chain of repositories.
> Here is some example output from a build:
>      local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
>      found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Posted by "Johan Stuyts (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12467280 ] 

Johan Stuyts commented on IVY-389:
----------------------------------

I think I found the problem: ChainResolver does not check the cache but leaves that to the child resolvers. A child resolver will only return an item from the cache if the item is resolved by itself.

I want to extend ChainResolver so it checks the cache before resolving the dependency using its child resolvers. The issue I am facing is: when is ChainResolver allowed to use the cache, and when must it resolve the dependency using its child resolvers?

To make sure the solution will not break anything I think the following assertions must hold:
- if the cache check is added to ChainResolver, it does not matter from which resolver the dependency in the cache came from. i.e. ChainResolver will return a dependency from any resolver from the cache.
- The 'returnFirst' option of ChainResolver does not influence the decision to use the cache or to use the child resolvers. 'returnFirst' only applies if the decision is made to search the child resolvers.
- ChainResolver is allowed to check the cache if all of the following conditions are satisfied:
    - the revision ID of the dependency is not dynamic.
    - The revision ID of the module is not changing (the changing matcher is not used at all in ChainResolver currently).
    - ChainResolver has 'checkmodified' set to 'false' (this option is not supported by ChainResolver currently).

Are the assertions above correct and is nothing missing?


> Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
> ----------------------------------------------------------------------------------------------
>
>                 Key: IVY-389
>                 URL: https://issues.apache.org/jira/browse/IVY-389
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Johan Stuyts
>            Priority: Minor
>
> With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.
> The above happens when 'returnFirst' is set to 'true' on the chain of repositories.
> Here is some example output from a build:
>      local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
>      found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (IVY-389) Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'

Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468282 ] 

Xavier Hanin commented on IVY-389:
----------------------------------

Thanks for your contribution Johan!

In a few words, I agree with almost all your assertions, and also with the fact that Ivy won't be fully backward compatible. Indeed the previous behaviour is impossible without a performance impact, so I agree that people should use checkModified="true" if they want to take into account a module descriptor dropped somewhere in the chain. The only case where I'm wondering if it's really a good thing is when the cached module descriptor is a default one (i.e. no module descriptor was found in the chain). In this case, I think we should search the chain each time to be compatible with the behaviour of other resolvers. This mean that the performance in this case won't be optimal, but most users are confused when a module descriptor is not found simply because they have used Ivy to resolve dependencies once before putting the module descriptor file. 

What do you think?

> Detection of newer and better artifacts should not happen if 'checkModified' is set to 'false'
> ----------------------------------------------------------------------------------------------
>
>                 Key: IVY-389
>                 URL: https://issues.apache.org/jira/browse/IVY-389
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: Johan Stuyts
>            Priority: Minor
>         Attachments: ivy-389.patch, ivy-389.patch
>
>
> With 'checkModified' set to 'false' Ivy still looks for an artifact in repositories when there is a copy of the artifact in the cache. The repositories that are searched are the ones that are specified before the repository from which the copy in the cache was retrieved. The latter is not contacted.
> The above happens when 'returnFirst' is set to 'true' on the chain of repositories.
> Here is some example output from a build:
>      local: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried C:\home\jstuyts\data\ivy\hippo-open-source\local/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>     CLIENT ERROR: Not Found url=http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hipporep: no ivy file nor artifact found for [ javax.jdo | jdo2-api | 2.0 ]
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/ivy-2.0.xml
>              tried http://repository.hippocms.org/ivy/javax.jdo/jdo2-api/2.0/jdo2-api-2.0.jar
>      hippomavenrep: revision in cache: [ javax.jdo | jdo2-api | 2.0 ]
>      found [ javax.jdo | jdo2-api | 2.0 ] in hippomavenrep

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.