You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by James Carman <ja...@carmanconsulting.com> on 2008/02/28 13:24:35 UTC

[all] M2 Dependency Version Ranges...

All,

In Proxy, I currently have my SLF4J dependency version declared like this:

<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>[1.4.0,)</version>
  <optional>true</optional>
</dependency>

With this, maven will download the latest version of SLF4J (1.5.0 I
believe) and use that during the build.  Do we have an official policy
regarding our dependency versions in our poms?

James

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [all] M2 Dependency Version Ranges...

Posted by James Carman <ja...@carmanconsulting.com>.
On 2/29/08, Jörg Schaible <Jo...@elsag-solutions.com> wrote:
> jcarman@carmanconsulting.com wrote:
>  > On 2/29/08, Jörg Schaible <Jo...@elsag-solutions.com> wrote:
>  >> sebb wrote:
>  >>  > On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote:
>  >>  >> All, >>
>  >>  >>  In Proxy, I currently have my SLF4J dependency version declared
>  >>  >> like this: >>
>  >>  >>  <dependency>
>  >>  >>   <groupId>org.slf4j</groupId>
>  >>  >>   <artifactId>slf4j-api</artifactId>
>  >>  >>   <version>[1.4.0,)</version>
>  >>  >>   <optional>true</optional>
>  >>  >>  </dependency>
>  >>  >>
>  >>  >>  With this, maven will download the latest version of SLF4J
>  >>  (1.5.0 I >>  believe) and use that during the build.  Do we have an
>  >>  official >>  policy regarding our dependency versions in our poms?
>  >>  > > Note that proxy trunk used to depend on [1.3.0.) - this builds
>  >>  and > tests OK using M2, even though one of the proxy classes uses
>  >>  a method > that was not introduced until 1.4.0. It was only because
>  >>  I happened to > try building proxy without Maven that the problem
>  >> was noticed.
>  >>
>  >>
>  >> Why do you wanna use locked versions at all? If you put
>  >>
>  >>
>  >>  <version>1.4.0</version>
>  >>
>  >>
>  >> into the POM, you are using this version unless it is
>  > overwritten by a dependencyManagement section or version
>  > resolution. We don't have currently any possibility anyway to
>  > test all versions of an artifact from 1.4.0 to latest 1.5.x
>  > in all combinations. So the single version simply states what
>  > you have used to test and build your package. Otherwise you
>  > would have to check any permutation.
>  >>
>  >>
>  >
>  > So, are you saying we should use "1.4.0" or "[1.4.0,)"?
>
>
> 1.4.0, but just my 2 cent
>
>  - Jörg
>
>  BTW: If you *know* that 1.5 is incompatible, then you may always use a range like [1.4.0,1.5.0), but you will have to ensure manually first, that 1.4.0 really can be used.
>

I thought I checked 1.3.0, but apparently I didn't.  I changed it to
specifically 1.3.0 and then hit the little refresh button in IntelliJ
IDEA.  Apparently that didn't work!  So, I did a build with 1.4.0
specifically set using Maven and it worked.

In this particular case, I don't really care.  My dependency is
optional anyway, so someone is going to have to specifically include
it in their pom if they want to use Proxy.  I just ran across the
version range stuff recently and thought that was the way folks were
supposed to do it.  But, Maven is smart enough to use the best version
possible if a project includes Proxy and wants to use a newer version
of SLF4J than what Proxy's pom uses.

>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [all] M2 Dependency Version Ranges...

Posted by Dennis Lundberg <de...@apache.org>.
Jörg Schaible wrote:
> jcarman@carmanconsulting.com wrote:
>> On 2/29/08, Jörg Schaible <Jo...@elsag-solutions.com> wrote:
>>> sebb wrote:
>>>  > On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote: 
>>>  >> All, >>
>>>  >>  In Proxy, I currently have my SLF4J dependency version declared
>>>  >> like this: >>
>>>  >>  <dependency>
>>>  >>   <groupId>org.slf4j</groupId>
>>>  >>   <artifactId>slf4j-api</artifactId>
>>>  >>   <version>[1.4.0,)</version>
>>>  >>   <optional>true</optional>
>>>  >>  </dependency>
>>>  >>
>>>  >>  With this, maven will download the latest version of SLF4J
>>>  (1.5.0 I >>  believe) and use that during the build.  Do we have an
>>>  official >>  policy regarding our dependency versions in our poms? 
>>>  > > Note that proxy trunk used to depend on [1.3.0.) - this builds
>>>  and > tests OK using M2, even though one of the proxy classes uses
>>>  a method > that was not introduced until 1.4.0. It was only because
>>>  I happened to > try building proxy without Maven that the problem
>>> was noticed. 
>>>
>>>
>>> Why do you wanna use locked versions at all? If you put
>>>
>>>
>>>  <version>1.4.0</version>
>>>
>>>
>>> into the POM, you are using this version unless it is
>> overwritten by a dependencyManagement section or version
>> resolution. We don't have currently any possibility anyway to
>> test all versions of an artifact from 1.4.0 to latest 1.5.x
>> in all combinations. So the single version simply states what
>> you have used to test and build your package. Otherwise you
>> would have to check any permutation.
>>>
>> So, are you saying we should use "1.4.0" or "[1.4.0,)"?
> 
> 1.4.0, but just my 2 cent

I agree with this. It is easier to understand, both for ourselves and 
for our users. As Jörg pointed out, it also easier to test, because 
there is only one version to test.

> - Jörg
> 
> BTW: If you *know* that 1.5 is incompatible, then you may always use a range like [1.4.0,1.5.0), but you will have to ensure manually first, that 1.4.0 really can be used.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [all] M2 Dependency Version Ranges...

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
jcarman@carmanconsulting.com wrote:
> On 2/29/08, Jörg Schaible <Jo...@elsag-solutions.com> wrote:
>> sebb wrote:
>>  > On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote: 
>>  >> All, >>
>>  >>  In Proxy, I currently have my SLF4J dependency version declared
>>  >> like this: >>
>>  >>  <dependency>
>>  >>   <groupId>org.slf4j</groupId>
>>  >>   <artifactId>slf4j-api</artifactId>
>>  >>   <version>[1.4.0,)</version>
>>  >>   <optional>true</optional>
>>  >>  </dependency>
>>  >>
>>  >>  With this, maven will download the latest version of SLF4J
>>  (1.5.0 I >>  believe) and use that during the build.  Do we have an
>>  official >>  policy regarding our dependency versions in our poms? 
>>  > > Note that proxy trunk used to depend on [1.3.0.) - this builds
>>  and > tests OK using M2, even though one of the proxy classes uses
>>  a method > that was not introduced until 1.4.0. It was only because
>>  I happened to > try building proxy without Maven that the problem
>> was noticed. 
>> 
>> 
>> Why do you wanna use locked versions at all? If you put
>> 
>> 
>>  <version>1.4.0</version>
>> 
>> 
>> into the POM, you are using this version unless it is
> overwritten by a dependencyManagement section or version
> resolution. We don't have currently any possibility anyway to
> test all versions of an artifact from 1.4.0 to latest 1.5.x
> in all combinations. So the single version simply states what
> you have used to test and build your package. Otherwise you
> would have to check any permutation.
>> 
>> 
> 
> So, are you saying we should use "1.4.0" or "[1.4.0,)"?

1.4.0, but just my 2 cent

- Jörg

BTW: If you *know* that 1.5 is incompatible, then you may always use a range like [1.4.0,1.5.0), but you will have to ensure manually first, that 1.4.0 really can be used.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [all] M2 Dependency Version Ranges...

Posted by James Carman <ja...@carmanconsulting.com>.
On 2/29/08, Jörg Schaible <Jo...@elsag-solutions.com> wrote:
> sebb wrote:
>  > On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote:
>  >> All,
>  >>
>  >>  In Proxy, I currently have my SLF4J dependency version declared
>  >> like this:
>  >>
>  >>  <dependency>
>  >>   <groupId>org.slf4j</groupId>
>  >>   <artifactId>slf4j-api</artifactId>
>  >>   <version>[1.4.0,)</version>
>  >>   <optional>true</optional>
>  >>  </dependency>
>  >>
>  >>  With this, maven will download the latest version of SLF4J (1.5.0 I
>  >>  believe) and use that during the build.  Do we have an official
>  >>  policy regarding our dependency versions in our poms?
>  >
>  > Note that proxy trunk used to depend on [1.3.0.) - this builds and
>  > tests OK using M2, even though one of the proxy classes uses a method
>  > that was not introduced until 1.4.0. It was only because I happened to
>  > try building proxy without Maven that the problem was noticed.
>
>
> Why do you wanna use locked versions at all? If you put
>
>
>  <version>1.4.0</version>
>
>
> into the POM, you are using this version unless it is overwritten by a dependencyManagement section or version resolution. We don't have currently any possibility anyway to test all versions of an artifact from 1.4.0 to latest 1.5.x in all combinations. So the single version simply states what you have used to test and build your package. Otherwise you would have to check any permutation.
>
>

So, are you saying we should use "1.4.0" or "[1.4.0,)"?

>  - Jörg
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


RE: [all] M2 Dependency Version Ranges...

Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
sebb wrote:
> On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote:
>> All,
>> 
>>  In Proxy, I currently have my SLF4J dependency version declared
>> like this: 
>> 
>>  <dependency>
>>   <groupId>org.slf4j</groupId>
>>   <artifactId>slf4j-api</artifactId>
>>   <version>[1.4.0,)</version>
>>   <optional>true</optional>
>>  </dependency>
>> 
>>  With this, maven will download the latest version of SLF4J (1.5.0 I
>>  believe) and use that during the build.  Do we have an official
>>  policy regarding our dependency versions in our poms?
> 
> Note that proxy trunk used to depend on [1.3.0.) - this builds and
> tests OK using M2, even though one of the proxy classes uses a method
> that was not introduced until 1.4.0. It was only because I happened to
> try building proxy without Maven that the problem was noticed.

Why do you wanna use locked versions at all? If you put

<version>1.4.0</version>

into the POM, you are using this version unless it is overwritten by a dependencyManagement section or version resolution. We don't have currently any possibility anyway to test all versions of an artifact from 1.4.0 to latest 1.5.x in all combinations. So the single version simply states what you have used to test and build your package. Otherwise you would have to check any permutation.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [all] M2 Dependency Version Ranges...

Posted by sebb <se...@gmail.com>.
On 28/02/2008, James Carman <ja...@carmanconsulting.com> wrote:
> All,
>
>  In Proxy, I currently have my SLF4J dependency version declared like this:
>
>  <dependency>
>   <groupId>org.slf4j</groupId>
>   <artifactId>slf4j-api</artifactId>
>   <version>[1.4.0,)</version>
>   <optional>true</optional>
>  </dependency>
>
>  With this, maven will download the latest version of SLF4J (1.5.0 I
>  believe) and use that during the build.  Do we have an official policy
>  regarding our dependency versions in our poms?

Note that proxy trunk used to depend on [1.3.0.) - this builds and
tests OK using M2, even though one of the proxy classes uses a method
that was not introduced until 1.4.0. It was only because I happened to
try building proxy without Maven that the problem was noticed.

>  James
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>  For additional commands, e-mail: dev-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org