You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "James P. White (JIRA)" <ji...@apache.org> on 2008/04/19 11:40:21 UTC

[jira] Created: (IVY-803) Cache can't distinguish artifacts with classifiers

Cache can't distinguish artifacts with classifiers
--------------------------------------------------

                 Key: IVY-803
                 URL: https://issues.apache.org/jira/browse/IVY-803
             Project: Ivy
          Issue Type: Bug
          Components: Maven Compatibility
    Affects Versions: 2.0.0-beta-2
            Reporter: James P. White


Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.

Presumably the fix is to include the classifier in the artifact pattern for the cache.

But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.



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


[jira] Commented: (IVY-803) Cache can't distinguish artifacts with classifiers

Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591790#action_12591790 ] 

Maarten Coene commented on IVY-803:
-----------------------------------

Maybe we should use the [originalname] token in the artifact pattern as default:
artifactPattern="[organisation]/[module]/[type]s/[originalname]"


> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Commented: (IVY-803) Cache can't distinguish artifacts with classifiers

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

Xavier Hanin commented on IVY-803:
----------------------------------

Using original name could be interesting, but the problem is that we don't know what is actually used in the original name. For instance, the pattern "[organisation]/[module]/[type]s/[originalname]" would lead to issues if the original name doesn't contain the revision. This could be solved by putting all known tokens in the directory name. But I see another drawback: with this pattern the cache wouldn't be unified anymore. Currently it's pretty easy to create tools analyzing the cache. With originalname token as artifact name, we don't control the file name, and depending on module origin we may have a very inconsistent cache. It can be bad also if you use the same cache with different settings, picking modules from different resolvers, with some modules shared available in different repositories, with different names.

For these reasons I'd prefer to use the solution to introduce the classifier token in pattern, as James did in the patch.

> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Commented: (IVY-803) Cache can't distinguish artifacts with classifiers

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

Xavier Hanin commented on IVY-803:
----------------------------------

Workaround for the cache:
Set the artifactPattern on caches element:
http://ant.apache.org/ivy/history/latest-milestone/configuration/caches.html
 
Example:
{noformat}
<ivysettings>
<caches artifactPattern="[organisation]/[module]/[type]s/[artifact]-[revision](-[classifier]).[ext]" />
</ivysettings>
{noformat}

If you use retrieve, you may have to change the pattern to and add the classifier.

In the resolver for ibiblio in m2compatible mode, there's nothing to do, it should work.

> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Updated: (IVY-803) Cache can't distinguish artifacts with classifiers

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

James P. White updated IVY-803:
-------------------------------

    Attachment: ivy803patch.txt

Patch, which wouldn't be worthwhile for the pattern change but because it fixes testcase (ResolveTest.testResolveMaven2Classifiers) to pass.

Doesn't actually try two different classifiers though (which can't actually be done in one resolve).

> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Commented: (IVY-803) Cache can't distinguish artifacts with classifiers

Posted by "James P. White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12590696#action_12590696 ] 

James P. White commented on IVY-803:
------------------------------------

Thanks!  Need a little tweak though.  Must also specify ivyPattern (lest an exception occurs), and based on looking at the source (DefaultRepositoryCacheManager) there is now a branch variable too.  

This is what worked for me:
{noformat}<ivysettings>
  <caches artifactPattern="[organisation]/[module](/[branch])/[type]s/[artifact]-[revision](-[classifier])(.[ext])"
          ivyPattern="[organisation]/[module](/[branch])/ivy-[revision].xml"/>
</ivysettings>
{noformat}



> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Assigned: (IVY-803) Cache can't distinguish artifacts with classifiers

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

Xavier Hanin reassigned IVY-803:
--------------------------------

    Assignee: Xavier Hanin

> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>            Assignee: Xavier Hanin
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Resolved: (IVY-803) Cache can't distinguish artifacts with classifiers

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

Xavier Hanin resolved IVY-803.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0-RC1

I've applied your patch with some more update to ResolveTest. Thanks a lot for your contribution!

> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>            Assignee: Xavier Hanin
>             Fix For: 2.0-RC1
>
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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


[jira] Commented: (IVY-803) Cache can't distinguish artifacts with classifiers

Posted by "James P. White (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/IVY-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591812#action_12591812 ] 

James P. White commented on IVY-803:
------------------------------------

That sounds promising to me.  The thing that bothers me about adding the classifier to the cache pattern is that I'm worried that this problem will just keep turning up with more kinds of resolvers and repositories.   Any kind of narrowing from the original source to the cache will inevitably lead to this problem.  I don't know enough about Ivy though to have any real idea of the right fix.


> Cache can't distinguish artifacts with classifiers
> --------------------------------------------------
>
>                 Key: IVY-803
>                 URL: https://issues.apache.org/jira/browse/IVY-803
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.0.0-beta-2
>            Reporter: James P. White
>         Attachments: ivy803patch.txt
>
>
> Once an artifact with a Maven classifier is in the cache, then that will match any classifier value.
> Presumably the fix is to include the classifier in the artifact pattern for the cache.
> But this seems a little obnoxious since AFAICT this problem may exist with all artifact patterns.

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