You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Derricutt <ma...@talios.com> on 2008/11/30 05:52:59 UTC

Version range madness...

'lo all,

A question on version ranges which is currently hurting my brain :)

In my repository I have version 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4,
1.2.5, and 1.2.6-SNAPSHOT deployed.  In my pom I have [1.2.0,)
declared as the version range.  This resolves to 1.2.0 whereas I
really want 1.2.6-SNAPSHOT to be resolved and used.  My understand is
that this means "any version greater than 1.2.0" but I really want
"the latest version greater than 1.2.0".  When I use [1.2.5,) maven
resolves 1.2.6-SNAPSHOT as I want, however this confuses me further as
I would have expected it to find 1.2.5.

Going from the other direction, I tried [,1.3.0) to say "anything up
to, but not including 1.3.0" which I expected would return
1.2.6-SNAPSHOT, but I still got 1.2.0.

Am I missing something simple here?  I'm using maven 2.0.9.

-- 
"It is easier to optimize correct code than to correct optimized
code." -- Bill Harlan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Version range madness...

Posted by Anders Hammar <an...@hammar.net>.
Hi,

I've seen the same behavior where version and versioning->release is
different in Nexus. Not sure exactly what it will affect. Possibly that is
the reason for your problem.
What happens if you remove the 1.2.0 artifact from (or even better any
version of that artifact) your local repo and then try to build? Will Maven
stil retrieve 1.2.0? If so, I'd guess it's the value of the version in the
metadata that's the cause. You could post a question regarding that on the
Nexus list - it might be a bug.

/Anders


Mark Derricutt wrote:
> 
> Deployed to my Nexus repository, the metadata for the release is:
> 
> <metadata>
>   <groupId>smx3</groupId>
>   <artifactId>smx3.partyresource</artifactId>
>   <version>1.2.0</version>
>   <versioning>
>     <release>1.2.5</release>
>     <versions>
>       <version>1.2.0</version>
>       <version>1.2.1</version>
>       <version>1.2.2</version>
>       <version>1.2.3</version>
>       <version>1.2.4</version>
>       <version>1.2.5</version>
>     </versions>
>     <lastUpdated>20081128050839</lastUpdated>
>   </versioning>
> </metadata>
> 
> and the snapshot:
> 
> <metadata>
>   <groupId>smx3</groupId>
>   <artifactId>smx3.partyresource</artifactId>
>   <version>1.2.0-SNAPSHOT</version>
>   <versioning>
>     <versions>
>       <version>1.2.0-SNAPSHOT</version>
>       <version>1.2.6-SNAPSHOT</version>
>     </versions>
>     <lastUpdated>20081130055646</lastUpdated>
>   </versioning>
> </metadata>
> 
> Interesting - why is version 1.2.0, whilst theres a release of 1.2.5?
> And the same with 1.2.0-SNAPSHOT as opposed to 1.2.6-SNAPSHOT.
> 
> In my settings.xml I have everything setup to mirror into nexus:
> 
>  <mirrors>
>     <mirror>
>       <id>Nexus</id>
>       <name>Nexus Public Mirror</name>
>       <url>http://XXX/nexus/content/groups/public</url>
>       <mirrorOf>*</mirrorOf>
>     </mirror>
>   </mirrors>
> 
> with two server entries declaring my user/password to deploy.
> 
>  <servers>
>     <server>
>       <id>smx-releases</id>
>       <username>admin</username>
>       <password>XXX</password>
>     </server>
>     <server>
>       <id>smx-snapshots</id>
>       <username>admin</username>
>       <password>XXX</password>
>     </server>
>   </servers>
> 
> On Sun, Nov 30, 2008 at 6:36 PM, Wayne Fay <wa...@gmail.com> wrote:
>>> In my repository I have version 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4,
>>> 1.2.5, and 1.2.6-SNAPSHOT deployed.  In my pom I have [1.2.0,)
>>> declared as the version range.  This resolves to 1.2.0 whereas I
>>> really want 1.2.6-SNAPSHOT to be resolved and used.  My understand is
>>
>> When you say "deployed", are you talking about actual remote
>> deployment to a Maven repo manager? If so, what software are you using
>> to host the repo? What does the content of the maven-metadata.xml file
>> look like on the server?
>>
>> Also, did you declare that your repo hosts snapshots as well as
>> releases in settings.xml?
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> 
> -- 
> "It is easier to optimize correct code than to correct optimized
> code." -- Bill Harlan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Version-range-madness...-tp20754597p20757279.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Version range madness...

Posted by Mark Derricutt <ma...@talios.com>.
Deployed to my Nexus repository, the metadata for the release is:

<metadata>
  <groupId>smx3</groupId>
  <artifactId>smx3.partyresource</artifactId>
  <version>1.2.0</version>
  <versioning>
    <release>1.2.5</release>
    <versions>
      <version>1.2.0</version>
      <version>1.2.1</version>
      <version>1.2.2</version>
      <version>1.2.3</version>
      <version>1.2.4</version>
      <version>1.2.5</version>
    </versions>
    <lastUpdated>20081128050839</lastUpdated>
  </versioning>
</metadata>

and the snapshot:

<metadata>
  <groupId>smx3</groupId>
  <artifactId>smx3.partyresource</artifactId>
  <version>1.2.0-SNAPSHOT</version>
  <versioning>
    <versions>
      <version>1.2.0-SNAPSHOT</version>
      <version>1.2.6-SNAPSHOT</version>
    </versions>
    <lastUpdated>20081130055646</lastUpdated>
  </versioning>
</metadata>

Interesting - why is version 1.2.0, whilst theres a release of 1.2.5?
And the same with 1.2.0-SNAPSHOT as opposed to 1.2.6-SNAPSHOT.

In my settings.xml I have everything setup to mirror into nexus:

 <mirrors>
    <mirror>
      <id>Nexus</id>
      <name>Nexus Public Mirror</name>
      <url>http://XXX/nexus/content/groups/public</url>
      <mirrorOf>*</mirrorOf>
    </mirror>
  </mirrors>

with two server entries declaring my user/password to deploy.

 <servers>
    <server>
      <id>smx-releases</id>
      <username>admin</username>
      <password>XXX</password>
    </server>
    <server>
      <id>smx-snapshots</id>
      <username>admin</username>
      <password>XXX</password>
    </server>
  </servers>

On Sun, Nov 30, 2008 at 6:36 PM, Wayne Fay <wa...@gmail.com> wrote:
>> In my repository I have version 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4,
>> 1.2.5, and 1.2.6-SNAPSHOT deployed.  In my pom I have [1.2.0,)
>> declared as the version range.  This resolves to 1.2.0 whereas I
>> really want 1.2.6-SNAPSHOT to be resolved and used.  My understand is
>
> When you say "deployed", are you talking about actual remote
> deployment to a Maven repo manager? If so, what software are you using
> to host the repo? What does the content of the maven-metadata.xml file
> look like on the server?
>
> Also, did you declare that your repo hosts snapshots as well as
> releases in settings.xml?
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>



-- 
"It is easier to optimize correct code than to correct optimized
code." -- Bill Harlan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Version range madness...

Posted by Wayne Fay <wa...@gmail.com>.
> In my repository I have version 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4,
> 1.2.5, and 1.2.6-SNAPSHOT deployed.  In my pom I have [1.2.0,)
> declared as the version range.  This resolves to 1.2.0 whereas I
> really want 1.2.6-SNAPSHOT to be resolved and used.  My understand is

When you say "deployed", are you talking about actual remote
deployment to a Maven repo manager? If so, what software are you using
to host the repo? What does the content of the maven-metadata.xml file
look like on the server?

Also, did you declare that your repo hosts snapshots as well as
releases in settings.xml?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org