Geoff,

thanks for the feedback.

IVY-1069 has been fixed in 2.1.0-rc2, but I never got a confirmation that it 
was really fixed.
Do you still have this problem with 2.1.0-rc2?

Maarten




----- Original Message ----
From: Geoff Clitheroe <[email protected]>
To: [email protected]
Sent: Friday, July 31, 2009 12:03:12 AM
Subject: Re: Using ivy:buildnumber with more than one url resolver

I'm guessing you where replying to Doug but for completeness....

The issues I initially had are discussed (by me alone) here
http://www.nabble.com/ivy%3Abuildnumber-bug-with-m2compatible-resolver--Ivy-2.1.0-rc1-to23643568.html#a23660603

This is very similar to http://issues.apache.org/jira/browse/IVY-1069
so I didn't add another.

The other issue I alluded to is already in Jira (and pretty easy to
work around anyway).
http://issues.apache.org/jira/browse/IVY-449

FWIW I tried to write some unit tests to replicate my bugs but failed
to get anything useful - it seems pretty hard to do this style of
integration testing in a portable way.  Any suggestions?

Also - I don't really see these as major limits, but it would be
useful to document the restrictions on using an M2 compatible resolver
and point out the work arounds.  I will try to do this but I'd be
really happy if someone beats me to it....

Cheers,

On Fri, Jul 31, 2009 at 9:30 AM, Maarten Coene<[email protected]> wrote:
>
> Could you open a JIRA issue and post your full Ant log there, together with 
> your settings.xml and build.xml
>
> Maarten
>
>
>
>
> ----- Original Message ----
> From: "Glidden, Douglass A" <[email protected]>
> To: [email protected]
> Sent: Thursday, July 30, 2009 8:15:03 PM
> Subject: Using ivy:buildnumber with more than one url resolver
>
> Hi,
>
> I've run into some weird behavior when the ivy buildnumber task is used with 
> a url resolver more than once in the same build.  Here's a sample scenario:
>
> Included in my resolvers are a releases resolver and a snapshots resolver, 
> which run against two repositories in the same Nexus repository manager.  The 
> snapshot revision number is based on the current release revision number, 
> e.g. if the latest revision in the releases repository is 0.6 then any new 
> snapshots created should be 0.7-SNAPSHOT-# (where # is incremented with each 
> new snapshot created).  My build then first runs ivy:buildnumber against the 
> releases resolver, then uses the result of that in running ivy:buildnumber 
> against the snapshots resolver.  The problem is that ivy:buildnumber doesn't 
> construct the URL correctly when it is re-run.  Here are relevant excerpts 
> from the debug output:
>
> When ivy:buildnumber is run against the releases resolver, then against the 
> snapshots resolver:
> ...
> [ivy:buildnumber]     using releases to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/].
> [ivy:buildnumber]         found 1 resources
> [ivy:buildnumber]     using releases to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/].
> [ivy:buildnumber]         found 1 resources
> [ivy:buildnumber]     using releases to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/ivy-0.6.xml].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/ivy-0.6.xml.md5].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/ivy-0.6.xml.sha1].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/myproject-0.6.jar].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/myproject-0.6.jar.md5].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/myproject-0.6.jar.sha1].
> [ivy:buildnumber]         found 6 urls
> [ivy:buildnumber]         1 matched 
> http://nexus.myorg.com:8081/nexus/content/repositories/releases/myorg/myproject/0.6/[artifact]-0.6.jar
> ...
> [ivy:buildnumber]     using snapshots to list all in 
> http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/.meta/].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/myorg/].
> [ivy:buildnumber]         found 2 resources
> [ivy:buildnumber]     using snapshots to list all in 
> http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/.meta/].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.myorg:8081/nexus/content/repositories/snapshots/myorg/].
> [ivy:buildnumber]         found 2 resources
> ...
>
> As you can see, when it runs against the snapshots resolver, it leaves off 
> the organisation and module tokens from the URL.  The problem is not with the 
> settings for the snapshots resolver, though, because when ivy:buildnumber is 
> run against the snapshots resolver without first running it against the 
> releases resolver, the output is normal:
> ...
> [ivy:buildnumber]     using snapshots to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/].
> [ivy:buildnumber]         found 1 resources
> [ivy:buildnumber]     using snapshots to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/].
> [ivy:buildnumber]         found 1 resources
> [ivy:buildnumber]     using snapshots to list all in 
> http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/ivy-0.7-SNAPSHOT-1.xml].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/ivy-0.7-SNAPSHOT-1.xml.md5].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/ivy-0.7-SNAPSHOT-1.xml.sha1].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/myproject-0.7-SNAPSHOT-1.jar].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/myproject-0.7-SNAPSHOT-1.jar.md5].
> [ivy:buildnumber] ApacheURLLister found 
> URL=[http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/myproject-0.7-SNAPSHOT-1.jar.sha1].
> [ivy:buildnumber]         found 6 urls
> [ivy:buildnumber]         1 matched 
> http://nexus.myorg.com:8081/nexus/content/repositories/snapshots/myorg/myproject/0.7-SNAPSHOT-1/[artifact]-0.7-SNAPSHOT-1.jar
> ...
>
> Relevant portions from the properties and ivysettings files:
> ...
> ivy.nexus.default.artifact.pattern=[organisation]/[module]/[revision]/[artifact]-[revision].[ext]
> ivy.nexus.default.ivy.pattern=[organisation]/[module]/[revision]/ivy-[revision].xml
> ivy.nexus.repositories.path=content/repositories
> ivy.nexus.releases.path=${ivy.nexus.repositories.path}/releases
> ivy.nexus.snapshots.path=${ivy.nexus.repositories.path}/snapshots
> ivy.nexus.url=http://nexus.myorg.com:8081/nexus
> ...
>
> ...
> <url name="releases" m2compatible="true">
>  <ivy 
> pattern="${ivy.nexus.url}/${ivy.nexus.releases.path}/${ivy.nexus.default.ivy.pattern}"
>  />
>  <artifact 
> pattern="${ivy.nexus.url}/${ivy.nexus.releases.path}/${ivy.nexus.default.artifact.pattern}"
>  />
> </url>
> <url name="snapshots" m2compatible="true">
>  <ivy 
> pattern="${ivy.nexus.url}/${ivy.nexus.snapshots.path}/${ivy.nexus.default.ivy.pattern}"
>  />
>  <artifact 
> pattern="${ivy.nexus.url}/${ivy.nexus.snapshots.path}/${ivy.nexus.default.artifact.pattern}"
>  />
> </url>
> ...
>
> The build file has two trivial targets; one calls ivy:buildnumber against the 
> releases resolver and the other calls it against the snapshots resolver.  
> Either target produces correct results when it is run by itself, but when 
> both targets are run (regardless of order), the second one to be run always 
> shows the behavior described above.
>
> Is this a bug or am I doing something wrong here?
>
> Thanks,
>
> Doug Glidden
> Software Engineer
> The Boeing Company
> [email protected]
>
>
>
>



      

Reply via email to