ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin (JIRA)" <>
Subject [jira] [Commented] (IVY-871) test and document PatternVersionMatcher
Date Mon, 27 Nov 2017 09:09:00 GMT


Martin commented on IVY-871:

Sure. We are publishing artifacts by following semantic versioning plus some extension to
mark a released artifact of a specific release. The format is like this {{1.2.3-X.Y}} or {{1.2.4-X.Y-SNAPSHOT}}.
All these artifacts are published to the same release repository. So we end up with having
various release artifacts (1.2.3-X.Y|-SNAPSHOT) and as well regular ones from trunk (1.2.3).

In order to get the latest artifacts from a specific release (X.Y) we cannot use the latest.release/snapshot
matchers. I read in the documentation about the version matchers and tried to implement something
that will get the latest revision from a specific release.

I have the following ivy settings:

<match revision="latestRel" pattern="\d+\.\d+\.\d+-${release}\.*" args="release" matcher="regexp"

I use the Ivy standalone tool by passing the ivysettings.xml and the dependency as following:

java -jar ivy.jar -settings ivysettings.xml -dependency com.acme mylib "latestRel(17.4)"

This works and pulls only the latest artifact with the release 17.4 only but I do not understand
why exactly and have the feeling that it works by accident.

> test and document PatternVersionMatcher
> ---------------------------------------
>                 Key: IVY-871
>                 URL:
>             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
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

View raw message