GitHub user barthel opened a pull request:

    https://github.com/apache/maven/pull/57

    MNG-3092: Add strategy based version range resolver.

    The discussion on issue 
[MNG-3092](https://issues.apache.org/jira/browse/MNG-3092) shows the seriously 
needs of different kinds of version range resolving in Maven.
    
    I know about the risk on changing the resolving mechanism in Maven.
    I always had the backward compatibility in mind, if I have something 
changed.
    I added some basic tests for the default version range resolver (strategy) 
before I've started with the refactoring.
    
    This pull request contains a solution based on the strategy pattern.
    
    The actual version range resolving algorithm **wasn't change** but moved 
into a strategy.
    The provided other strategies are, more or less, only result filter around 
the result of the default version range strategy.
    
    These changes are only placed in _maven-aether-provider_.
    
    ----
    
    The original ```DefaultVersionRangeResolver``` will be replaced by the
    new strategy pattern based version range resolver.
    
    The actual version range resolving algorithm, formerly located in
    ```DefaultVersionRangeResolver```, is moved into a new strategy class
    ```MavenDefaultVersionRangeResolver``` with the name/hint 
```"mavenDefault"```.
    The resolving algorithm **WAS NOT CHANGED**.
    
    The new ```StrategyVersionRangeResolver``` will be registered as new
    default version range resolver (without name/hint).
    Additional strategies are registered as ```VersionRangeResolver``` with a
    unique name/hint.
    
    The used strategy will be configured in ```StrategyVersionRangeResolver```
    via the Maven system parameter 
```-Dmaven.versionRangeResolver.strategy=...```.
    
    If no strategy is configured or the strategy is unknown, the Maven
    default version range resolver ```"mavenDefault"``` will be used.
    Otherwise the named strategy will be used.
    
    The following strategies are available:
    * ```MavenDefaultVersionRangeResolver``` ```"mavenDefault"```
     * the actual UNTOUCHED default
     * resolves all versions including all _SNAPSHOT_ versions.
    * ```ReleaseOnBoundariesVersionRangeResolver``` ```"releaseOnBoundaries"```
     * Used the ```MavenDefaultVersionRangeResolver``` internally and filters
    the result. Removes all SNAPSHOT versions at the begin and the end of
    the resolved versions list until to a released version.
    * ```OnlyReleaseVersionRangeResolver``` ```"onlyReleases"```
     * Used the ```MavenDefaultVersionRangeResolver``` internally and filters
    the result. Removes all SNAPSHOT versions at the resolved versions list.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/barthel/maven MNG-3092

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven/pull/57.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #57
    
----
commit c7454d1a3275ba865e010d0fc016b711450907fb
Author: barthel <[email protected]>
Date:   2015-04-30T12:37:52Z

    MNG-3092: Add basic tests for DefaultVersionRangeResolver.

commit bc45cb41d1e7651f537304bdce2a7f82fcaa9215
Author: barthel <[email protected]>
Date:   2015-07-02T22:06:00Z

    MNG-3092: Add strategy based version range resolver.
    
    The original ```DefaultVersionRangeResolver``` will be replaced by the
    new strategy pattern based version range resolver.
    
    The actual version range resolving algorithm, formerly located in
    ```DefaultVersionRangeResolver```, is moved into a new strategy class
    ```MavenDefaultVersionRangeResolver``` with the name/hint 
```"mavenDefault"```.
    The resolving algorithm WAS NOT CHANGED.
    
    The new ```StrategyVersionRangeResolver``` will be registered as new
    default version range resolver (without name/hint).
    Additional strategies are registered as ```VersionRangeResolver``` with a
    unique name/hint.
    
    The used strategy will be configured in ```StrategyVersionRangeResolver```
    via the Maven system parameter 
```-Dmaven.versionRangeResolver.strategy=...```.
    
    If no strategy is configured or the strategy is unknown, the Maven
    default version range resolver ```"mavenDefault"``` will be used.
    Otherwise the named strategy will be used.
    
    The following strategies are available:
    * ```MavenDefaultVersionRangeResolver``` ```"mavenDefault"```
    ** the actual UNTOUCHED default
    ** resolves all versions including all _SNAPSHOT_ versions.
    * ```ReleaseOnBoundariesVersionRangeResolver``` ```"releaseOnBoundaries"```
    ** Used the ```MavenDefaultVersionRangeResolver``` internally and filters
    the result. Removes all SNAPSHOT versions at the begin and the end of
    the resolved versions list until to a released version.
    * ```OnlyReleaseVersionRangeResolver``` ```"onlyReleases"```
    ** Used the ```MavenDefaultVersionRangeResolver``` internally and filters
    the result. Removes all SNAPSHOT versions at the resolved versions list.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to