maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason van Zyl <ja...@takari.io>
Subject Re: maven git commit: [MNG-2199] Support version ranges in parent elements
Date Sun, 13 Dec 2015 03:10:09 GMT
Nice.

> On Dec 12, 2015, at 3:05 PM, schulte@apache.org wrote:
> 
> Repository: maven
> Updated Branches:
>  refs/heads/master 8c863b01a -> 62629c9bc
> 
> 
> [MNG-2199] Support version ranges in parent elements
> 
> o Updated to remove version range resolution logic obsolete since 3.2.3.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/maven/repo
> Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/62629c9b
> Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/62629c9b
> Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/62629c9b
> 
> Branch: refs/heads/master
> Commit: 62629c9bc537800f4019cbb5d643d274c9378f04
> Parents: 8c863b0
> Author: Christian Schulte <schulte@apache.org>
> Authored: Sat Dec 12 21:03:42 2015 +0100
> Committer: Christian Schulte <schulte@apache.org>
> Committed: Sat Dec 12 21:03:42 2015 +0100
> 
> ----------------------------------------------------------------------
> .../maven/project/DefaultProjectBuilder.java    | 41 --------------------
> .../project/DefaultProjectBuildingRequest.java  | 17 +++++++-
> .../maven/project/ProjectBuildingRequest.java   | 16 +++++++-
> 3 files changed, 29 insertions(+), 45 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/maven/blob/62629c9b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
> ----------------------------------------------------------------------
> diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
> index 9d51a6d..5c8e707 100644
> --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
> +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
> @@ -73,9 +73,6 @@ import org.eclipse.aether.repository.RemoteRepository;
> import org.eclipse.aether.repository.WorkspaceRepository;
> import org.eclipse.aether.resolution.ArtifactRequest;
> import org.eclipse.aether.resolution.ArtifactResult;
> -import org.eclipse.aether.resolution.VersionRangeRequest;
> -import org.eclipse.aether.resolution.VersionRangeResolutionException;
> -import org.eclipse.aether.resolution.VersionRangeResult;
> 
> /**
>  */
> @@ -298,44 +295,6 @@ public class DefaultProjectBuilder
> 
>         boolean localProject;
> 
> -        if ( request.isResolveVersionRanges() )
> -        {
> -            VersionRangeRequest versionRangeRequest = new VersionRangeRequest( pomArtifact,
config.repositories, null );
> -
> -            try
> -            {
> -                VersionRangeResult versionRangeResult =
> -                    repoSystem.resolveVersionRange( config.session, versionRangeRequest
);
> -
> -                if ( versionRangeResult.getHighestVersion() == null )
> -                {
> -                    throw new ProjectBuildingException(
> -                        artifact.getId(), "Error resolving project artifact: No versions
matched the requested range",
> -                        (Throwable) null );
> -
> -                }
> -
> -                if ( versionRangeResult.getVersionConstraint() != null
> -                         && versionRangeResult.getVersionConstraint().getRange()
!= null
> -                         && versionRangeResult.getVersionConstraint().getRange().getUpperBound()
== null )
> -                {
> -                    throw new ProjectBuildingException(
> -                        artifact.getId(),
> -                        "Error resolving project artifact: The requested version range
does not specify an upper bound",
> -                        (Throwable) null );
> -
> -                }
> -
> -                pomArtifact = pomArtifact.setVersion( versionRangeResult.getHighestVersion().toString()
);
> -            }
> -            catch ( VersionRangeResolutionException e )
> -            {
> -                throw new ProjectBuildingException(
> -                    artifact.getId(), "Error resolving project artifact: " + e.getMessage(),
e );
> -
> -            }
> -        }
> -
>         try
>         {
>             ArtifactRequest pomRequest = new ArtifactRequest();
> 
> http://git-wip-us.apache.org/repos/asf/maven/blob/62629c9b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
> ----------------------------------------------------------------------
> diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
> index f439240..5a22afe 100644
> --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
> +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuildingRequest.java
> @@ -62,6 +62,7 @@ public class DefaultProjectBuildingRequest
> 
>     private boolean resolveDependencies;
> 
> +    @Deprecated
>     private boolean resolveVersionRanges;
> 
>     private RepositoryMerging repositoryMerging = RepositoryMerging.POM_DOMINANT;
> @@ -221,14 +222,26 @@ public class DefaultProjectBuildingRequest
>         return resolveDependencies;
>     }
> 
> -    /** @since 3.2.2 */
> +    /**
> +     * @since 3.2.2
> +     * @deprecated This got added when implementing MNG-2199 and is no longer used.
> +     * Commit 6cf9320942c34bc68205425ab696b1712ace9ba4 updated the way 'MavenProject'
objects are initialized.
> +     * Commit 8c863b01af76d990b7650add5cb98efda4c83533 moved parent version range resolution
to the 'ModelBuilder'.
> +     */
> +    @Deprecated
>     public ProjectBuildingRequest setResolveVersionRanges( boolean value )
>     {
>         this.resolveVersionRanges = value;
>         return this;
>     }
> 
> -    /** @since 3.2.2 */
> +    /**
> +     * @since 3.2.2
> +     * @deprecated This got added when implementing MNG-2199 and is no longer used.
> +     * Commit 6cf9320942c34bc68205425ab696b1712ace9ba4 updated the way 'MavenProject'
objects are initialized.
> +     * Commit 8c863b01af76d990b7650add5cb98efda4c83533 moved parent version range resolution
to the 'ModelBuilder'.
> +     */
> +    @Deprecated
>     public boolean isResolveVersionRanges()
>     {
>         return this.resolveVersionRanges;
> 
> http://git-wip-us.apache.org/repos/asf/maven/blob/62629c9b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
> ----------------------------------------------------------------------
> diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
> index 0380278..ff639cc 100644
> --- a/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
> +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java
> @@ -168,10 +168,22 @@ public interface ProjectBuildingRequest
>      */
>     RepositoryMerging getRepositoryMerging();
> 
> -    /** @since 3.2.2 */
> +    /**
> +     * @since 3.2.2
> +     * @deprecated This got added when implementing MNG-2199 and is no longer used.
> +     * Commit 6cf9320942c34bc68205425ab696b1712ace9ba4 updated the way 'MavenProject'
objects are initialized.
> +     * Commit 8c863b01af76d990b7650add5cb98efda4c83533 moved parent version range resolution
to the 'ModelBuilder'.
> +     */
> +    @Deprecated
>     boolean isResolveVersionRanges();
> 
> -    /** @since 3.2.2 */
> +    /**
> +     * @since 3.2.2
> +     * @deprecated This got added when implementing MNG-2199 and is no longer used.
> +     * Commit 6cf9320942c34bc68205425ab696b1712ace9ba4 updated the way 'MavenProject'
objects are initialized.
> +     * Commit 8c863b01af76d990b7650add5cb98efda4c83533 moved parent version range resolution
to the 'ModelBuilder'.
> +     */
> +    @Deprecated
>     ProjectBuildingRequest setResolveVersionRanges( boolean value );
> 
>     /**
> 

Thanks,

Jason

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

To think is easy. To act is hard. But the hardest thing in the world is to act in accordance
with your thinking.

 -- Johann von Goethe













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


Mime
View raw message