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 Ja...@rzf.fin-nrw.de on 2010/07/06 10:12:34 UTC

[module] not resolved like the repomanager provides the artifact

We use Nexus as repository manager and it provides a jar with an
organizsation=com.acme as .../com/acme/...
But Ivy tries to download as .../com.acme/...

Is there something I have forgotten to configure?


Jan

PatternVersionMatcher breaks dynamic revisions

Posted by Nathan Franzen <Na...@mmodal.com>.
I've been experimenting with the version matchers, and after some experiments got a PatternVersionMatcher that was doing the lookups on a particular dependency the way I wanted it too.   Unfortunately, I then saw other dependencies -- which we working before -- now failing. 

Trying to break it down into the simplest test case, I have in my ivy.xml, either
        <dependency org="com.mmodal" name="devTools" rev="[4.0,)" />
or
        <dependency org="com.mmodal" name="devTools" rev="4.0.+" />
which should (and do) give me version 4.0.102


now in ivy settings, I add or remove 
     <version-matchers>
        <pattern-vm/>
     </version-matchers>
which turns off or on the successful lookup.

I glanced at the source of org.apache.ivy.plugins.version.PatternVersionMatcher, but I don't see anything obvious fishy.  I don't know what code is involved in initializing the set of version matchers, so it's hard for me to know where something's gone wrong.

Of course I first used -verbose, but don't see anything helpful in the output.

Nathan 


 

 

RE: PatternVersionMatcher breaks dynamic revisions

Posted by Nathan Franzen <Na...@mmodal.com>.
So ok, I traced through where isDynamic is called, and thought about it a little, and guessed the answer.

If you do not define a set of version-matchers explicitly, then you get the usual ones, Latest, Sub Revision, Version Range, etc.  But if you do define a custom matcher, say:

  <version-matchers>
     <pattern-vm>
        <match revision="versionconfig" pattern="${versionbase}\.\d+-(${config}|complete)" args="versionbase,config" matcher="regexp"/> 
     </pattern-vm>
  </version-matchers>

it is interpreted as a complete definition of ALL version matchers -- and you no longer have available the default version matchers.   1.0.+ is no longer interpreted as a dynamic lookup.

So the correct definition is instead:

  <version-matchers>
     <exact-vm/>
     <latest-vm/>
     <sub-vm/>
     <range-vm/>
     <pattern-vm>
        <match revision="versionconfig" pattern="${versionbase}\.\d+-(${config}|complete)" args="versionbase,config" matcher="regexp"/> 
     </pattern-vm>
  </version-matchers>

A little more verbose than expected.   <chain-vm/> might be what I really want here, but I haven't found a description of it.


Nathan

 

 

> -----Original Message-----
> From: Nathan Franzen
> Sent: Tuesday, July 06, 2010 12:31 PM
> To: 'ivy-user@ant.apache.org'
> Subject: PatternVersionMatcher breaks dynamic revisions
> 
> I've been experimenting with the version matchers, and after some
> experiments got a PatternVersionMatcher that was doing the lookups on a
> particular dependency the way I wanted it too.   Unfortunately, I then
> saw other dependencies -- which we working before -- now failing.
> 
> Trying to break it down into the simplest test case, I have in my
> ivy.xml, either
>         <dependency org="com.mmodal" name="devTools" rev="[4.0,)" />
> or
>         <dependency org="com.mmodal" name="devTools" rev="4.0.+" />
> which should (and do) give me version 4.0.102
> 
> 
> now in ivy settings, I add or remove
>      <version-matchers>
>         <pattern-vm/>
>      </version-matchers>
> which turns off or on the successful lookup.
> 
> I glanced at the source of
> org.apache.ivy.plugins.version.PatternVersionMatcher, but I don't see
> anything obvious fishy.  I don't know what code is involved in
> initializing the set of version matchers, so it's hard for me to know
> where something's gone wrong.
> 
> Of course I first used -verbose, but don't see anything helpful in the
> output.
> 
> Nathan
> 
> 
> 
> 
> 

Re: AW: AW: [module] not resolved like the repomanager provides the artifact

Posted by Maarten Coene <ma...@yahoo.com>.
Great!

Maarten



----- Original Message ----
From: "Jan.Materne@rzf.fin-nrw.de" <Ja...@rzf.fin-nrw.de>
To: ivy-user@ant.apache.org
Sent: Tue, July 6, 2010 12:13:27 PM
Subject: AW: AW: [module] not resolved like the repomanager provides the artifact

>do you have this problem with the upcoming 2.2.0-rc1 version as well?
>
>Maarten

I hope I havent changed anything else than the Ivy version .... with
2.2.0-rc1 it worked. ;)
So I'll upgrade that, thanks.


Jan



      

AW: AW: [module] not resolved like the repomanager provides the artifact

Posted by Ja...@rzf.fin-nrw.de.
>do you have this problem with the upcoming 2.2.0-rc1 version as well?
>
>Maarten

I hope I havent changed anything else than the Ivy version .... with
2.2.0-rc1 it worked. ;)
So I'll upgrade that, thanks.


Jan

Re: AW: [module] not resolved like the repomanager provides the artifact

Posted by Maarten Coene <ma...@yahoo.com>.
Jan,

do you have this problem with the upcoming 2.2.0-rc1 version as well?

Maarten




----- Original Message ----
From: "Jan.Materne@rzf.fin-nrw.de" <Ja...@rzf.fin-nrw.de>
To: ivy-user@ant.apache.org
Sent: Tue, July 6, 2010 10:56:51 AM
Subject: AW: [module] not resolved like the repomanager provides the artifact

>>>> We use Nexus as repository manager and it provides a jar with an
>>>> organizsation=com.acme as .../com/acme/...
>>>> But Ivy tries to download as .../com.acme/...
>>>>
>>>> Is there something I have forgotten to configure?
>>>
>>>probably the m2compatible=true flag on the resolver configuration ?
>>
>>
>>It is set to true:
>>
>>      <ibiblio name="public" m2compatible="true"
>>root="${repo.rzf.root}"/>
>>
>>I also tried the root-URL with and without trailing slash 
>(found a note
>>on that).
>
>
>Running with -verbose I got a hint:
>[ivy:retrieve] CLIENT ERROR: Forbidden
>url=http://<MYREPO>/com/acme/MyJar/Version/MyJar-Version.jar
>
>Invoking that URL with Firefox I could download the jar.
>
>Nexus has an active userId "anonymous" with roles "Nexus 
>Anonymous Role"
>and "Repo: All Repositories (Read)".

The funny thing is that other artifacts (also com.acme#otherJar pattern)
are downloaded...


Jan



      

AW: [module] not resolved like the repomanager provides the artifact

Posted by Ja...@rzf.fin-nrw.de.
>>>> We use Nexus as repository manager and it provides a jar with an
>>>> organizsation=com.acme as .../com/acme/...
>>>> But Ivy tries to download as .../com.acme/...
>>>>
>>>> Is there something I have forgotten to configure?
>>>
>>>probably the m2compatible=true flag on the resolver configuration ?
>>
>>
>>It is set to true:
>>
>>      <ibiblio name="public" m2compatible="true"
>>root="${repo.rzf.root}"/>
>>
>>I also tried the root-URL with and without trailing slash 
>(found a note
>>on that).
>
>
>Running with -verbose I got a hint:
>[ivy:retrieve] CLIENT ERROR: Forbidden
>url=http://<MYREPO>/com/acme/MyJar/Version/MyJar-Version.jar
>
>Invoking that URL with Firefox I could download the jar.
>
>Nexus has an active userId "anonymous" with roles "Nexus 
>Anonymous Role"
>and "Repo: All Repositories (Read)".

The funny thing is that other artifacts (also com.acme#otherJar pattern)
are downloaded...


Jan

AW: [module] not resolved like the repomanager provides the artifact

Posted by Ja...@rzf.fin-nrw.de.
>>> We use Nexus as repository manager and it provides a jar with an
>>> organizsation=com.acme as .../com/acme/...
>>> But Ivy tries to download as .../com.acme/...
>>>
>>> Is there something I have forgotten to configure?
>>
>>probably the m2compatible=true flag on the resolver configuration ?
>
>
>It is set to true:
>
>      <ibiblio name="public" m2compatible="true"
>root="${repo.rzf.root}"/>
>
>I also tried the root-URL with and without trailing slash (found a note
>on that).


Running with -verbose I got a hint:
[ivy:retrieve] CLIENT ERROR: Forbidden
url=http://<MYREPO>/com/acme/MyJar/Version/MyJar-Version.jar

Invoking that URL with Firefox I could download the jar.

Nexus has an active userId "anonymous" with roles "Nexus Anonymous Role"
and "Repo: All Repositories (Read)".



Jan

AW: [module] not resolved like the repomanager provides the artifact

Posted by Ja...@rzf.fin-nrw.de.
>> We use Nexus as repository manager and it provides a jar with an
>> organizsation=com.acme as .../com/acme/...
>> But Ivy tries to download as .../com.acme/...
>>
>> Is there something I have forgotten to configure?
>
>probably the m2compatible=true flag on the resolver configuration ?
>
>Nicolas


It is set to true:

      <ibiblio name="public" m2compatible="true"
root="${repo.rzf.root}"/>

I also tried the root-URL with and without trailing slash (found a note
on that).


Jan

Re: [module] not resolved like the repomanager provides the artifact

Posted by Nicolas Lalevée <ni...@hibnet.org>.
On Tuesday 06 July 2010 10:12:34 Jan.Materne@rzf.fin-nrw.de wrote:
> We use Nexus as repository manager and it provides a jar with an
> organizsation=com.acme as .../com/acme/...
> But Ivy tries to download as .../com.acme/...
>
> Is there something I have forgotten to configure?

probably the m2compatible=true flag on the resolver configuration ?

Nicolas