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: '[email protected]'
> 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
> 
> 
> 
> 
> 

Reply via email to