You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Hans Dockter <ha...@gradle.biz> on 2010/07/13 17:27:24 UTC

Update policy for Maven snapshots

Hi,

is there any standard way in Ivy to express the Maven feature of a
snapshot-policy? The latter allows you to define the frequency for an up to
date check:

always - always check when Maven is started for newer versions of snapshots
never - never check for newer remote versions. Once off manual updates can
be performed.
daily (default) - check on the first run of the day (local time)
interval:XXX - check every XXX minutes

I think such a policy makes sense in particular if your repo is accessed via
the internet vs. an intranet company repo. Otherwise using snapshots carries
a high performance penalty.

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Re: Update policy for Maven snapshots

Posted by Hans Dockter <ma...@dockter.biz>.
The Jira (including my solution) for that issue is:
https://issues.apache.org/jira/browse/IVY-1210

Cheers,

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Re: Update policy for Maven snapshots

Posted by Hans Dockter <ma...@dockter.biz>.
I think always doing a remote check for Maven snapshots is a critical
problem for any Ivy user working with Maven snapshot repositories. It can
slow down the build to a point were it is basically unusable when you have
many snapshots.

I have tried to add a custom VersionMatcher for Maven snapshots that
considers .*-SNAPSHOT as dynamic. Then I run into the issues that dynamic
version names must be transformed before a resolve. Otherwise Ivy throws an
exception. In that case that requirement doesn't seem to be necessary. It
looks like a blocker for an easy solution via VersionMatchers that work with
the current IBiblioResolver.

The solution I have implemented is to have a custom version of the
IBiblioResolver which overwrites the findModuleInCache method. Although this
works, I think a solution that integrates into the very nice generic dynamic
version handling of Ivy would be much better. I will file a Jira.

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Re: Update policy for Maven snapshots

Posted by Hans Dockter <ma...@dockter.biz>.
On Wed, Jul 14, 2010 at 8:39 AM, Hans Dockter <ma...@dockter.biz> wrote:

> Hi Marteen,
>
> On Wed, Jul 14, 2010 at 12:23 AM, Maarten Coene <ma...@yahoo.com>wrote:
>
>> Did you look at the 'defaultTTL' attribute on the <cache> element in your
>> settings.xml ?
>>
>> http://ant.apache.org/ivy/history/latest-milestone/settings/caches/cache.html
>
>
> thanks a lot for pointing this out. This works fine for me with dynamic Ivy
> revisions (e.g. 4.+). But for Maven snapshots it seems not to work.
>
> I think this might be related to the IBibilioResolver using a changing
> pattern. In the debug output I get the following for Maven snapshots:
>
> *don't use cache for org.grails#grails-resources;1.1.1-SNAPSHOT:
> changing=true*
>
> **So the TTL do not seem to hook in for snapshots as the cache seems to be
> circumvented in any case.
>
> The only solution I can think of is either modifying IBiblio or adding a
> custom resolver that points to the ivy cache which only resolves SNAPSHOT
> according to a timing pattern. Anything else you can think of?
>

At the moment I'm experimenting with a custom VersionMatcher for maven
snapshots. I'm wondering why Ivy is not using VersionMatcher for dealing
with Maven snapshots (like you do for other dynamic revisions). What was the
reason to put the snapshot handling logic in the IBiblioResolver? Do you see
any blockers by going down the VersionMatcher road?

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Re: Update policy for Maven snapshots

Posted by Hans Dockter <ma...@dockter.biz>.
Hi Marteen,

On Wed, Jul 14, 2010 at 12:23 AM, Maarten Coene <ma...@yahoo.com>wrote:

> Did you look at the 'defaultTTL' attribute on the <cache> element in your
> settings.xml ?
>
> http://ant.apache.org/ivy/history/latest-milestone/settings/caches/cache.html


thanks a lot for pointing this out. This works fine for me with dynamic Ivy
revisions (e.g. 4.+). But for Maven snapshots it seems not to work.

I think this might be related to the IBibilioResolver using a changing
pattern. In the debug output I get the following for Maven snapshots:

*don't use cache for org.grails#grails-resources;1.1.1-SNAPSHOT:
changing=true*

**So the TTL do not seem to hook in for snapshots as the cache seems to be
circumvented in any case.

The only solution I can think of is either modifying IBiblio or adding a
custom resolver that points to the ivy cache which only resolves SNAPSHOT
according to a timing pattern. Anything else you can think of?

Thanks

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz


>
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: Hans Dockter <ha...@gradle.biz>
> To: ivy-user@ant.apache.org
> Sent: Tue, July 13, 2010 5:27:24 PM
> Subject: Update policy for Maven snapshots
>
> Hi,
>
> is there any standard way in Ivy to express the Maven feature of a
> snapshot-policy? The latter allows you to define the frequency for an up to
> date check:
>
> always - always check when Maven is started for newer versions of snapshots
> never - never check for newer remote versions. Once off manual updates can
> be performed.
> daily (default) - check on the first run of the day (local time)
> interval:XXX - check every XXX minutes
>
> I think such a policy makes sense in particular if your repo is accessed
> via
> the internet vs. an intranet company repo. Otherwise using snapshots
> carries
> a high performance penalty.
>
> - Hans
>
> --
> Hans Dockter
> Founder, Gradle
> http://www.gradle.org, http://twitter.com/gradleorg
> CEO, Gradle Inc. - Gradle Training, Support, Consulting
> http://www.gradle.biz
>
>
>
>
>

Re: Update policy for Maven snapshots

Posted by Maarten Coene <ma...@yahoo.com>.
Did you look at the 'defaultTTL' attribute on the <cache> element in your 
settings.xml ?
http://ant.apache.org/ivy/history/latest-milestone/settings/caches/cache.html

Maarten




----- Original Message ----
From: Hans Dockter <ha...@gradle.biz>
To: ivy-user@ant.apache.org
Sent: Tue, July 13, 2010 5:27:24 PM
Subject: Update policy for Maven snapshots

Hi,

is there any standard way in Ivy to express the Maven feature of a
snapshot-policy? The latter allows you to define the frequency for an up to
date check:

always - always check when Maven is started for newer versions of snapshots
never - never check for newer remote versions. Once off manual updates can
be performed.
daily (default) - check on the first run of the day (local time)
interval:XXX - check every XXX minutes

I think such a policy makes sense in particular if your repo is accessed via
the internet vs. an intranet company repo. Otherwise using snapshots carries
a high performance penalty.

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz