You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Martin (JIRA)" <ji...@apache.org> on 2017/11/27 08:37:00 UTC

[jira] [Commented] (IVY-871) test and document PatternVersionMatcher

    [ https://issues.apache.org/jira/browse/IVY-871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16266510#comment-16266510 ] 

Martin commented on IVY-871:
----------------------------

I am having troubles understanding this pattern version matcher. I am looking for a solution that returns me the latest revision based on some specific pattern and couldn't find in the docs a proper explanation how to do that.

While Google returns me two examples for that use case I am not sure whether the end result is expected or just luck.

Example:
https://stackoverflow.com/questions/25549166/latest-stable-revision-with-ivy-excluding-alpha-beta-releases/26213500?noredirect=1#comment81908072_26213500

If I try this out it seems to work and return me the latest revision but it would be great to get a confirmation that this is expected behaviour.

> test and document PatternVersionMatcher
> ---------------------------------------
>
>                 Key: IVY-871
>                 URL: https://issues.apache.org/jira/browse/IVY-871
>             Project: Ivy
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Xavier Hanin
>            Assignee: Maarten Coene
>             Fix For: 2.1.0-RC2
>
>         Attachments: patch.txt
>
>
> There is a powerful version matcher in Ivy code base called PatternVersionMatcher. Unfortunately, this matcher is not documented, not tested, and not declared in the default typedef.properties. Nobody remembers where it comes from, but code analysis should be enough to understand how it works and what it can achieve.
> Here's what I understand from a quick analysis:
> {code:title=settings.xml}
> <pattern-vm>
>   <match revision="micro" pattern="${major}\.${minor}\.\d+" args="major, minor" matcher="regexp" />
> </pattern-vm>
> {code}
> {code:title=ivy.xml}
> <dependency org="acme" name="foo" rev="micro(1, 3)" />
> {code}
> If I understand correctly the code, this will match any revision like 1.3.<any number>.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)