On Jun 14, 2014, at 4:18 AM, Christian Schulte <c...@schulte.it> wrote:

> Am 06/14/14 08:39, schrieb Hervé BOUTEMY:
>> this is one of the problems when using version ranges, tied to 
>> reproducibility 
>> and definition of the algorithm for Maven to choose one version in the range 
>> adapted to the actual context.
> 
> It's not only about version ranges. It seems inconsistent to allow the
> following to build at all. No ranges involved.
> 
> <version>1.0</version>
> 
> <dependency>
>  <version>2.2-SNAPSHOT</version>
> </dependency>
> 
> This should make Maven error out immediately stating that a non-snapshot
> POM cannot depend on a snapshot POM. Maven could do this for ranges
> automatically.
> 
> <version>1.0-SNAPSHOT</version>
> 
> <dependency>
>  <version>[1.*]</version>
> </dependency>
> 
> The range [1.*] may resolve to a SNAPSHOT version. Changing the version
> of that POM to
> 
> <version>1.0</version>
> 
> the range [1.*] may not resolve to a snapshot version.
> 

This mechanism implies that we have special understanding of SNAPSHOT. Which 
I'm not saying is wrong, but imagine a situation where we move to a model more 
based on continuous delivery where everything is complete and released with 
what we consider a release version. I'm just thinking aloud here I think that 
what you want to select is more a function of what repositories you are 
resolving against. So if you want to pick what are considered pre-release 
artifacts then you allow resolution against repositories with pre-release 
artifacts. If you are preparing for a release then an adjustment is made and 
you only resolve against what you consider released artifacts.

Then there is no magic contextual selection based on resolving against an 
ungoverned body of content in a bunch of repositories you might pull in through 
a single grouped URL, but fully normal range calculations with the 
understanding that you have constrained what is visible by resolver. We already 
have the pattern where we separate release from pre-release artifacts, and even 
in a CD model I believe this would be the case, so it seems simpler to me to 
come with an easy way to change what is resolved against in development vs the 
production of a release.

>> but the question is: how to avoid non-SNAPSHOT resolution/choice when doing 
>> a 
>> release, while resolving SNAPSHOTs when not doing a release?
>> How to affect the algorithm that magically choose on version in the range?
> 
> Why not the same way 'release:prepare' enforces above logic ?
> 
> Regards,
> -- 
> Christian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

Selfish deeds are the shortest path to self destruction.

 -- The Seven Samuari, Akira Kurosawa









Reply via email to