You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sc...@apache.org on 2016/07/01 17:25:36 UTC

[1/6] maven git commit: [MNG-4645] Move central repo definition out of Maven's core so it can be more easily changed. [Forced Update!]

Repository: maven
Updated Branches:
  refs/heads/MNG-6006 499c975db -> bec762043 (forced update)


[MNG-4645] Move central repo definition out of Maven's core so it can be more easily changed.

o Updated to stop falling back to some hard-coded default 'central' repository,
  if no such repository is setup in the settings or the POM. This means there
  is no such thing as a default repository other than what is shipped with
  the default settings anymore.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/15a9c32f
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/15a9c32f
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/15a9c32f

Branch: refs/heads/MNG-6006
Commit: 15a9c32f6775f10fb5317ad6cddfafd72d7f9e8d
Parents: 5077f22
Author: Christian Schulte <sc...@apache.org>
Authored: Thu Jun 30 08:12:52 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Thu Jun 30 08:18:08 2016 +0200

----------------------------------------------------------------------
 apache-maven/src/conf/settings.xml              |  6 ++
 .../maven/bridge/MavenRepositorySystem.java     | 33 +++++-----
 .../DefaultMavenExecutionRequestPopulator.java  | 67 +++-----------------
 .../maven/repository/RepositorySystem.java      | 15 +++++
 .../project/AbstractMavenProjectTestCase.java   | 13 +++-
 .../artifact/DefaultMavenMetadataCacheTest.java | 36 +++++++++--
 .../maven/repository/TestRepositorySystem.java  | 10 +--
 7 files changed, 95 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/apache-maven/src/conf/settings.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/settings.xml b/apache-maven/src/conf/settings.xml
index 81f3560..8d903f2 100644
--- a/apache-maven/src/conf/settings.xml
+++ b/apache-maven/src/conf/settings.xml
@@ -245,6 +245,9 @@ under the License.
     </profile>
     -->
 
+    <!--
+    | Default profile holding various defaults.
+    |-->
     <profile>
       <id>default</id>
 
@@ -257,6 +260,9 @@ under the License.
           <snapshots>
             <enabled>false</enabled>
           </snapshots>
+          <releases>
+            <updatePolicy>never</updatePolicy>
+          </releases>
         </repository>
       </repositories>
 

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java b/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
index 9331710..428ade0 100644
--- a/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
+++ b/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java
@@ -416,8 +416,8 @@ public class MavenRepositorySystem
         }
 
         return new ArtifactRepositoryPolicy( enabled, updatePolicy, checksumPolicy );
-    }    
-    
+    }
+
     public ArtifactRepository createArtifactRepository( String id, String url, String layoutId,
                                                         ArtifactRepositoryPolicy snapshots,
                                                         ArtifactRepositoryPolicy releases )
@@ -439,7 +439,7 @@ public class MavenRepositorySystem
                                                 repositoryId ) );
         }
     }
-    
+
     public static ArtifactRepository createArtifactRepository( String id, String url,
                                                         ArtifactRepositoryLayout repositoryLayout,
                                                         ArtifactRepositoryPolicy snapshots,
@@ -564,20 +564,21 @@ public class MavenRepositorySystem
         return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier, handler,
                                     optional );
     }
-    
+
     //
     // Code taken from LegacyRepositorySystem
     //
-        
+    /**
+     * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
+     * {@code central} if such a repository is not provided in the settings or the POM.
+     */
+    @Deprecated
     public ArtifactRepository createDefaultRemoteRepository( MavenExecutionRequest request )
         throws Exception
     {
-        return createRepository( RepositorySystem.DEFAULT_REMOTE_REPO_URL, RepositorySystem.DEFAULT_REMOTE_REPO_ID,
-                                 true, ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY, false,
-                                 ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY,
-                                 ArtifactRepositoryPolicy.CHECKSUM_POLICY_WARN );
+        throw new UnsupportedOperationException();
     }
-    
+
     public ArtifactRepository createRepository( String url, String repositoryId, boolean releases,
                                                  String releaseUpdates, boolean snapshots, String snapshotUpdates,
                                                  String checksumPolicy ) throws Exception
@@ -590,7 +591,7 @@ public class MavenRepositorySystem
 
         return createArtifactRepository( repositoryId, url, "default", snapshotsPolicy, releasesPolicy );
     }
-        
+
     public Set<String> getRepoIds( List<ArtifactRepository> repositories )
     {
         Set<String> repoIds = new HashSet<>();
@@ -605,8 +606,8 @@ public class MavenRepositorySystem
 
         return repoIds;
     }
-    
-    
+
+
     public ArtifactRepository createLocalRepository( MavenExecutionRequest request, File localRepository )
         throws Exception
     {
@@ -615,8 +616,8 @@ public class MavenRepositorySystem
                                  ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS, true,
                                  ArtifactRepositoryPolicy.UPDATE_POLICY_ALWAYS,
                                  ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE );
-    }    
-    
+    }
+
     private static final String WILDCARD = "*";
 
     private static final String EXTERNAL_WILDCARD = "external:*";
@@ -781,5 +782,5 @@ public class MavenRepositorySystem
         }
 
         return result;
-    }    
+    }
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
index ba5630e..2bed92f 100644
--- a/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
+++ b/maven-core/src/main/java/org/apache/maven/execution/DefaultMavenExecutionRequestPopulator.java
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -33,18 +32,12 @@ import org.apache.maven.artifact.InvalidRepositoryException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.bridge.MavenRepositorySystem;
 import org.apache.maven.repository.RepositorySystem;
-//
-// All of this needs to go away and be couched in terms of the execution request
-//
 import org.apache.maven.settings.Mirror;
 import org.apache.maven.settings.Proxy;
 import org.apache.maven.settings.Repository;
 import org.apache.maven.settings.Server;
 import org.apache.maven.settings.Settings;
 import org.apache.maven.settings.SettingsUtils;
-//
-// Settings in core
-//
 import org.apache.maven.toolchain.model.PersistedToolchains;
 import org.apache.maven.toolchain.model.ToolchainModel;
 import org.codehaus.plexus.util.StringUtils;
@@ -53,9 +46,9 @@ import org.codehaus.plexus.util.StringUtils;
 public class DefaultMavenExecutionRequestPopulator
     implements MavenExecutionRequestPopulator
 {
-            
+
     private final MavenRepositorySystem repositorySystem;
-    
+
     @Inject
     public DefaultMavenExecutionRequestPopulator( MavenRepositorySystem repositorySystem )
     {
@@ -85,7 +78,7 @@ public class DefaultMavenExecutionRequestPopulator
         }
         return request;
     }
-    
+
     @Override
     public MavenExecutionRequest populateDefaults( MavenExecutionRequest request )
         throws MavenExecutionRequestPopulationException
@@ -96,59 +89,19 @@ public class DefaultMavenExecutionRequestPopulator
 
         populateDefaultPluginGroups( request );
 
-        injectDefaultRepositories( request );
-
-        injectDefaultPluginRepositories( request );
-
         return request;
     }
-    
+
     //
     //
     //
-    
+
     private void populateDefaultPluginGroups( MavenExecutionRequest request )
     {
         request.addPluginGroup( "org.apache.maven.plugins" );
         request.addPluginGroup( "org.codehaus.mojo" );
     }
 
-    private void injectDefaultRepositories( MavenExecutionRequest request )
-        throws MavenExecutionRequestPopulationException
-    {
-        Set<String> definedRepositories = repositorySystem.getRepoIds( request.getRemoteRepositories() );
-
-        if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) )
-        {
-            try
-            {
-                request.addRemoteRepository( repositorySystem.createDefaultRemoteRepository( request ) );
-            }
-            catch ( Exception e )
-            {
-                throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e );
-            }
-        }
-    }
-
-    private void injectDefaultPluginRepositories( MavenExecutionRequest request )
-        throws MavenExecutionRequestPopulationException
-    {
-        Set<String> definedRepositories = repositorySystem.getRepoIds( request.getPluginArtifactRepositories() );
-
-        if ( !definedRepositories.contains( RepositorySystem.DEFAULT_REMOTE_REPO_ID ) )
-        {
-            try
-            {
-                request.addPluginArtifactRepository( repositorySystem.createDefaultRemoteRepository( request ) );
-            }
-            catch ( Exception e )
-            {
-                throw new MavenExecutionRequestPopulationException( "Cannot create default remote repository.", e );
-            }
-        }
-    }
-
     private void localRepository( MavenExecutionRequest request )
         throws MavenExecutionRequestPopulationException
     {
@@ -206,10 +159,10 @@ public class DefaultMavenExecutionRequestPopulator
         {
             request.setBaseDirectory( request.getPom().getAbsoluteFile().getParentFile() );
         }
-    }   
-    
+    }
+
     /*if_not[MAVEN4]*/
-    
+
     @Override
     @Deprecated
     public MavenExecutionRequest populateFromSettings( MavenExecutionRequest request, Settings settings )
@@ -311,8 +264,8 @@ public class DefaultMavenExecutionRequestPopulator
         }
 
         return request;
-    }    
-    
+    }
+
     /*end[MAVEN4]*/
 
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
----------------------------------------------------------------------
diff --git a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
index fcc0f77..5766b98 100644
--- a/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
+++ b/maven-core/src/main/java/org/apache/maven/repository/RepositorySystem.java
@@ -50,8 +50,18 @@ public interface RepositorySystem
 
     File defaultUserLocalRepository = new File( userMavenConfigurationHome, "repository" );
 
+    /**
+     * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
+     * {@code central} if such a repository is not provided in the settings or the POM.
+     */
+    @Deprecated
     String DEFAULT_REMOTE_REPO_ID = "central";
 
+    /**
+     * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
+     * {@code central} if such a repository is not provided in the settings or the POM.
+     */
+    @Deprecated
     String DEFAULT_REMOTE_REPO_URL = "https://repo.maven.apache.org/maven2";
 
     Artifact createArtifact( String groupId, String artifactId, String version, String packaging );
@@ -70,6 +80,11 @@ public interface RepositorySystem
     ArtifactRepository buildArtifactRepository( Repository repository )
         throws InvalidRepositoryException;
 
+    /**
+     * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
+     * {@code central} if such a repository is not provided in the settings or the POM.
+     */
+    @Deprecated
     ArtifactRepository createDefaultRemoteRepository()
         throws InvalidRepositoryException;
 

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
index 71616fa..7db65d8 100644
--- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
+++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
@@ -23,7 +23,10 @@ import java.net.URL;
 import java.util.Arrays;
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.model.building.ModelBuildingException;
 import org.apache.maven.model.building.ModelProblem;
 import org.apache.maven.repository.RepositorySystem;
@@ -172,9 +175,17 @@ public abstract class AbstractMavenProjectTestCase
     protected MavenProject getProjectFromRemoteRepository( final File pom )
         throws Exception
     {
+        final ArtifactRepository testRepository =
+            new MavenArtifactRepository( "test",
+                                         "file://" + new File( System.getProperty( "basedir", "" ),
+                                                               "src/test/remote-repo" ).toURI().getPath(),
+                                         new DefaultRepositoryLayout(),
+                                         new ArtifactRepositoryPolicy(),
+                                         new ArtifactRepositoryPolicy() );
+
         final ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
         configuration.setLocalRepository( this.getLocalRepository() );
-        configuration.setRemoteRepositories( Arrays.asList( this.repositorySystem.createDefaultRemoteRepository() ) );
+        configuration.setRemoteRepositories( Arrays.asList( testRepository ) );
         initRepoSession( configuration );
 
         return projectBuilder.build( pom, configuration ).getProject();

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
index 6b103b2..dde864a 100644
--- a/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/artifact/DefaultMavenMetadataCacheTest.java
@@ -19,11 +19,15 @@ package org.apache.maven.project.artifact;
  * under the License.
  */
 
+import java.io.File;
 import java.util.Arrays;
 import java.util.Collections;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
+import org.apache.maven.artifact.repository.MavenArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
 import org.apache.maven.project.artifact.DefaultMavenMetadataCache.CacheKey;
 import org.apache.maven.repository.DelegatingLocalArtifactRepository;
@@ -53,19 +57,36 @@ public class DefaultMavenMetadataCacheTest
         super.tearDown();
     }
 
+    @SuppressWarnings( "deprecation" )
     public void testCacheKey()
         throws Exception
     {
         Artifact a1 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" );
-        @SuppressWarnings( "deprecation" )
-        ArtifactRepository lr1 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
-        ArtifactRepository rr1 = repositorySystem.createDefaultRemoteRepository();
+        ArtifactRepository lr1 =
+            new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
+
+        ArtifactRepository rr1 = new MavenArtifactRepository( "test",
+                                                              "file://" + new File( System.getProperty( "basedir", "" ),
+                                                                                    "src/test/remote-repo" ).toURI().
+                                                              getPath(),
+                                                              new DefaultRepositoryLayout(),
+                                                              new ArtifactRepositoryPolicy(),
+                                                              new ArtifactRepositoryPolicy() );
+
         a1.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) );
 
         Artifact a2 = repositorySystem.createArtifact( "testGroup", "testArtifact", "1.2.3", "jar" );
-        @SuppressWarnings( "deprecation" )
-        ArtifactRepository lr2 = new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
-        ArtifactRepository rr2 = repositorySystem.createDefaultRemoteRepository();
+        ArtifactRepository lr2 =
+            new DelegatingLocalArtifactRepository( repositorySystem.createDefaultLocalRepository() );
+
+        ArtifactRepository rr2 = new MavenArtifactRepository( "test",
+                                                              "file://" + new File( System.getProperty( "basedir", "" ),
+                                                                                    "src/test/remote-repo" ).toURI().
+                                                              getPath(),
+                                                              new DefaultRepositoryLayout(),
+                                                              new ArtifactRepositoryPolicy(),
+                                                              new ArtifactRepositoryPolicy() );
+
         a2.setDependencyFilter( new ExcludesArtifactFilter( Arrays.asList( "foo" ) ) );
 
         // sanity checks
@@ -76,6 +97,7 @@ public class DefaultMavenMetadataCacheTest
         CacheKey k1 = new CacheKey( a1, false, lr1, Collections.singletonList( rr1 ) );
         CacheKey k2 = new CacheKey( a2, false, lr2, Collections.singletonList( rr2 ) );
 
-        assertEquals(k1.hashCode(), k2.hashCode());
+        assertEquals( k1.hashCode(), k2.hashCode() );
     }
+
 }

http://git-wip-us.apache.org/repos/asf/maven/blob/15a9c32f/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
----------------------------------------------------------------------
diff --git a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
index 0e054c6..5a76b26 100644
--- a/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
+++ b/maven-core/src/test/java/org/apache/maven/repository/TestRepositorySystem.java
@@ -106,13 +106,15 @@ public class TestRepositorySystem
         return createLocalRepository( new File( System.getProperty( "basedir", "" ), "target/local-repo" ).getAbsoluteFile() );
     }
 
+    /**
+     * @deprecation As of 3.4, Maven no longer falls back to a hard-coded default repository with identifier
+     * {@code central} if such a repository is not provided in the settings or the POM.
+     */
+    @Deprecated
     public ArtifactRepository createDefaultRemoteRepository()
         throws InvalidRepositoryException
     {
-        return new MavenArtifactRepository( DEFAULT_REMOTE_REPO_ID, "file://"
-            + new File( System.getProperty( "basedir", "" ), "src/test/remote-repo" ).toURI().getPath(),
-                                            new DefaultRepositoryLayout(), new ArtifactRepositoryPolicy(),
-                                            new ArtifactRepositoryPolicy() );
+        throw new UnsupportedOperationException();
     }
 
     public Artifact createDependencyArtifact( Dependency dependency )


[4/6] maven git commit: [MNG-6006] Import Aether to Maven codebase

Posted by sc...@apache.org.
[MNG-6006] Import Aether to Maven codebase


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/34eb39f3
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/34eb39f3
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/34eb39f3

Branch: refs/heads/MNG-6006
Commit: 34eb39f31b77d5800934074eee64f10abba162e6
Parents: c2018a4
Author: Christian Schulte <sc...@apache.org>
Authored: Fri Jun 10 16:50:33 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Fri Jul 1 19:25:15 2016 +0200

----------------------------------------------------------------------
 apache-maven/pom.xml              |  6 +++---
 maven-aether-provider/pom.xml     | 14 +++++++-------
 maven-artifact/pom.xml            |  2 +-
 maven-builder-support/pom.xml     |  2 +-
 maven-compat/pom.xml              | 12 ++++++------
 maven-core/pom.xml                | 10 +++++-----
 maven-embedder/pom.xml            |  6 +++---
 maven-model-builder/pom.xml       |  2 +-
 maven-model/pom.xml               |  2 +-
 maven-plugin-api/pom.xml          |  2 +-
 maven-repository-metadata/pom.xml |  2 +-
 maven-settings-builder/pom.xml    |  2 +-
 maven-settings/pom.xml            |  2 +-
 pom.xml                           | 16 ++++++++--------
 14 files changed, 40 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/apache-maven/pom.xml
----------------------------------------------------------------------
diff --git a/apache-maven/pom.xml b/apache-maven/pom.xml
index ec11cc2..75fe35b 100644
--- a/apache-maven/pom.xml
+++ b/apache-maven/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>apache-maven</artifactId>
@@ -84,11 +84,11 @@ under the License.
       <artifactId>wagon-file</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-connector-basic</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-transport-wagon</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-aether-provider/pom.xml
----------------------------------------------------------------------
diff --git a/maven-aether-provider/pom.xml b/maven-aether-provider/pom.xml
index 9d7cfd5..7a77ed9 100644
--- a/maven-aether-provider/pom.xml
+++ b/maven-aether-provider/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-aether-provider</artifactId>
@@ -47,19 +47,19 @@ under the License.
       <artifactId>maven-repository-metadata</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-spi</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-impl</artifactId>
     </dependency>
     <dependency>
@@ -104,12 +104,12 @@ under the License.
     </dependency>
     <!-- Testing -->
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-connector-basic</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-transport-wagon</artifactId>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-artifact/pom.xml
----------------------------------------------------------------------
diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 503e097..e3943c9 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-artifact</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-builder-support/pom.xml
----------------------------------------------------------------------
diff --git a/maven-builder-support/pom.xml b/maven-builder-support/pom.xml
index 5cc3d8d..2ecb87e 100644
--- a/maven-builder-support/pom.xml
+++ b/maven-builder-support/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-builder-support</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-compat/pom.xml
----------------------------------------------------------------------
diff --git a/maven-compat/pom.xml b/maven-compat/pom.xml
index 9588dd2..2bcecf8 100644
--- a/maven-compat/pom.xml
+++ b/maven-compat/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-compat</artifactId>
@@ -71,15 +71,15 @@ under the License.
       <artifactId>maven-aether-provider</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-impl</artifactId>
     </dependency>
     <dependency>
@@ -109,12 +109,12 @@ under the License.
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-connector-basic</artifactId>
       <scope>test</scope>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-transport-wagon</artifactId>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-core/pom.xml
----------------------------------------------------------------------
diff --git a/maven-core/pom.xml b/maven-core/pom.xml
index adf63a6..e5df796 100644
--- a/maven-core/pom.xml
+++ b/maven-core/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-core</artifactId>
@@ -77,19 +77,19 @@ under the License.
       <artifactId>maven-aether-provider</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-impl</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-spi</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-util</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-embedder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-embedder/pom.xml b/maven-embedder/pom.xml
index f9973c5..87372e8 100644
--- a/maven-embedder/pom.xml
+++ b/maven-embedder/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-embedder</artifactId>
@@ -63,11 +63,11 @@ under the License.
       <artifactId>maven-model-builder</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.eclipse.aether</groupId>
+      <groupId>org.apache.maven.aether</groupId>
       <artifactId>aether-util</artifactId>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-model-builder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml
index b6ea3cd..0dd08ac 100644
--- a/maven-model-builder/pom.xml
+++ b/maven-model-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-model-builder</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-model/pom.xml
----------------------------------------------------------------------
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 29c454c..41cf168 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-model</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-plugin-api/pom.xml
----------------------------------------------------------------------
diff --git a/maven-plugin-api/pom.xml b/maven-plugin-api/pom.xml
index d4fc9af..a8ca3d0 100644
--- a/maven-plugin-api/pom.xml
+++ b/maven-plugin-api/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-plugin-api</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-repository-metadata/pom.xml
----------------------------------------------------------------------
diff --git a/maven-repository-metadata/pom.xml b/maven-repository-metadata/pom.xml
index 1bef9ef..7480de7 100644
--- a/maven-repository-metadata/pom.xml
+++ b/maven-repository-metadata/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-repository-metadata</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-settings-builder/pom.xml
----------------------------------------------------------------------
diff --git a/maven-settings-builder/pom.xml b/maven-settings-builder/pom.xml
index 886031c..2d415c9 100644
--- a/maven-settings-builder/pom.xml
+++ b/maven-settings-builder/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-settings-builder</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/maven-settings/pom.xml
----------------------------------------------------------------------
diff --git a/maven-settings/pom.xml b/maven-settings/pom.xml
index 39b1791..133ee32 100644
--- a/maven-settings/pom.xml
+++ b/maven-settings/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
+    <version>3.5.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-settings</artifactId>

http://git-wip-us.apache.org/repos/asf/maven/blob/34eb39f3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c447507..f850b31 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
   </parent>
 
   <artifactId>maven</artifactId>
-  <version>3.4.0-SNAPSHOT</version>
+  <version>3.5.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Apache Maven</name>
@@ -64,7 +64,7 @@ under the License.
     <cipherVersion>1.7</cipherVersion>
     <modelloVersion>1.8.3</modelloVersion>
     <jxpathVersion>1.3</jxpathVersion>
-    <aetherVersion>1.0.2.v20150114</aetherVersion>
+    <aetherVersion>1.2.0-SNAPSHOT</aetherVersion>
     <!-- Upgrade of SLF4J blocked by SLF4J-370 (MNG-6023). -->
     <!--   https://issues.apache.org/jira/browse/MNG-6023  -->
     <!--   http://jira.qos.ch/browse/SLF4J-370             -->
@@ -356,32 +356,32 @@ under the License.
       </dependency>
       <!--  Repository -->
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-api</artifactId>
         <version>${aetherVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-spi</artifactId>
         <version>${aetherVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-impl</artifactId>
         <version>${aetherVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-util</artifactId>
         <version>${aetherVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-connector-basic</artifactId>
         <version>${aetherVersion}</version>
       </dependency>
       <dependency>
-        <groupId>org.eclipse.aether</groupId>
+        <groupId>org.apache.maven.aether</groupId>
         <artifactId>aether-transport-wagon</artifactId>
         <version>${aetherVersion}</version>
       </dependency>


[6/6] maven git commit: [MNG-5988] Dependency mediation should prioritize transitive dependencies based on scope.

Posted by sc...@apache.org.
[MNG-5988] Dependency mediation should prioritize transitive dependencies based on scope.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/bec76204
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/bec76204
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/bec76204

Branch: refs/heads/MNG-6006
Commit: bec762043f0d900a471d49de3a3ac7cef096e401
Parents: d7967a5
Author: Christian Schulte <sc...@apache.org>
Authored: Fri Jul 1 16:41:52 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Fri Jul 1 19:25:15 2016 +0200

----------------------------------------------------------------------
 .../internal/MavenRepositorySystemUtils.java    |   7 +-
 .../maven/project/ProjectClasspathTest.java     | 124 +++++++++++++------
 .../projects/scope/transitive-compile-dep.xml   |   8 +-
 .../projects/scope/transitive-default-dep.xml   |   7 +-
 .../projects/scope/transitive-provided-dep.xml  |   8 +-
 .../projects/scope/transitive-runtime-dep.xml   |   7 +-
 .../projects/scope/transitive-test-dep.xml      |   7 +-
 7 files changed, 121 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
----------------------------------------------------------------------
diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
index b0b0a8d..cd15a85 100644
--- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
+++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
@@ -41,6 +41,7 @@ import org.eclipse.aether.util.graph.selector.ScopeDependencySelector;
 import org.eclipse.aether.util.graph.transformer.ChainedDependencyGraphTransformer;
 import org.eclipse.aether.util.graph.transformer.ConflictResolver;
 import org.eclipse.aether.util.graph.transformer.JavaDependencyContextRefiner;
+import org.eclipse.aether.util.graph.transformer.JavaDependencyMediator;
 import org.eclipse.aether.util.graph.transformer.JavaScopeDeriver;
 import org.eclipse.aether.util.graph.transformer.JavaScopeSelector;
 import org.eclipse.aether.util.graph.transformer.NearestVersionSelector;
@@ -103,12 +104,12 @@ public final class MavenRepositorySystemUtils
                                        new OptionalDependencySelector(), new ExclusionDependencySelector() );
         session.setDependencySelector( depFilter );
 
-        DependencyGraphTransformer transformer =
+        DependencyGraphTransformer conflictResolver =
             new ConflictResolver( new NearestVersionSelector(), new JavaScopeSelector(),
                                   new SimpleOptionalitySelector(), new JavaScopeDeriver() );
 
-        session.setDependencyGraphTransformer(
-            new ChainedDependencyGraphTransformer( transformer, new JavaDependencyContextRefiner() ) );
+        session.setDependencyGraphTransformer( new ChainedDependencyGraphTransformer(
+            new JavaDependencyMediator(), conflictResolver, new JavaDependencyContextRefiner() ) );
 
         DefaultArtifactTypeRegistry stereotypes = new DefaultArtifactTypeRegistry();
         stereotypes.add( new DefaultArtifactType( "pom" ) );

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
index d7ae86e..3463e94 100644
--- a/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
+++ b/maven-compat/src/test/java/org/apache/maven/project/ProjectClasspathTest.java
@@ -30,13 +30,16 @@ import org.eclipse.aether.impl.ArtifactResolver;
 public class ProjectClasspathTest
     extends AbstractMavenProjectTestCase
 {
+
     static final String dir = "projects/scope/";
 
     public void setUp()
         throws Exception
     {
         ArtifactResolver resolver = lookup( ArtifactResolver.class, "classpath" );
-        DefaultArtifactDescriptorReader pomReader = (DefaultArtifactDescriptorReader)lookup(ArtifactDescriptorReader.class);
+        DefaultArtifactDescriptorReader pomReader =
+            (DefaultArtifactDescriptorReader) lookup( ArtifactDescriptorReader.class );
+
         pomReader.setArtifactResolver( resolver );
 
         projectBuilder = lookup( ProjectBuilder.class, "classpath" );
@@ -70,55 +73,98 @@ public class ProjectClasspathTest
         checkArtifactIdScope( project, "runtime", "runtime" );
         checkArtifactIdScope( project, "default", "compile" );
 
-        // check all transitive deps of a test dependency are test, except test and provided which is skipped
-        artifact = getArtifact( project, "maven-test-test", "scope-provided" );
-        assertNull( "Check no provided dependencies are transitive", artifact );
-        artifact = getArtifact( project, "maven-test-test", "scope-test" );
-        assertNull( "Check no test dependencies are transitive", artifact );
-
-        artifact = getArtifact( project, "maven-test-test", "scope-compile" );
-        assertNotNull( artifact );
-
-        System.out.println( "a = " + artifact );
-        System.out.println( "b = " + artifact.getScope() );
-        assertEquals( "Check scope", "test", artifact.getScope() );
+        // check transitive dependencies of test scope dependency
         artifact = getArtifact( project, "maven-test-test", "scope-default" );
-        assertEquals( "Check scope", "test", artifact.getScope() );
+        assertNull( "Unexpected transitive dependency of test dependency", artifact );
+        artifact = getArtifact( project, "maven-test-test", "scope-test" );
+        assertNull( "Unexpected transitive dependency of test dependency", artifact );
         artifact = getArtifact( project, "maven-test-test", "scope-runtime" );
-        assertEquals( "Check scope", "test", artifact.getScope() );
+        assertNull( "Unexpected transitive dependency of test dependency", artifact );
+        artifact = getArtifact( project, "maven-test-test", "scope-compile" );
+        assertNull( "Unexpected transitive dependency of test dependency", artifact );
+        artifact = getArtifact( project, "maven-test-test", "scope-provided" );
+        assertNull( "Unexpected transitive dependency of test dependency", artifact );
 
-        // check all transitive deps of a provided dependency are provided scope, except for test
-        checkGroupIdScope( project, "provided", "maven-test-provided" );
+        // check transitive dependencies of provided scope dependency
+        artifact = getArtifact( project, "maven-test-provided", "scope-default" );
+        assertNull( "Unexpected transitive dependency of provided dependency", artifact );
+        artifact = getArtifact( project, "maven-test-provided", "scope-test" );
+        assertNull( "Unexpected transitive dependency of provided dependency", artifact );
         artifact = getArtifact( project, "maven-test-provided", "scope-runtime" );
-        assertEquals( "Check scope", "provided", artifact.getScope() );
+        assertNull( "Unexpected transitive dependency of provided dependency", artifact );
+        artifact = getArtifact( project, "maven-test-provided", "scope-compile" );
+        assertNull( "Unexpected transitive dependency of provided dependency", artifact );
+        artifact = getArtifact( project, "maven-test-provided", "scope-provided" );
+        assertNull( "Unexpected transitive dependency of provided dependency", artifact );
+
+        // check transitive dependencies of runtime scope dependency
+        artifact = getArtifact( project, "maven-test-runtime", "scope-default" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-runtime", "scope-test" );
+        assertNull( "Unexpected transitive dependency", artifact );
+
+        artifact = getArtifact( project, "maven-test-runtime", "scope-runtime" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-runtime", "scope-compile" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-runtime", "scope-provided" );
+        assertNull( "Unexpected transitive dependency", artifact );
 
-        // check all transitive deps of a runtime dependency are runtime scope, except for test
-        checkGroupIdScope( project, "runtime", "maven-test-runtime" );
         artifact = getArtifact( project, "maven-test-runtime", "scope-runtime" );
-        assertEquals( "Check scope", "runtime", artifact.getScope() );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        // check transitive dependencies of compile scope dependency
+        artifact = getArtifact( project, "maven-test-compile", "scope-default" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive compile scope", "compile", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-compile", "scope-test" );
+        assertNull( "Unexpected transitive dependency", artifact );
+
+        artifact = getArtifact( project, "maven-test-compile", "scope-runtime" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-compile", "scope-compile" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive compile scope", "compile", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-compile", "scope-provided" );
+        assertNull( "Unexpected transitive dependency", artifact );
 
-        // check all transitive deps of a compile dependency are compile scope, except for runtime and test
-        checkGroupIdScope( project, "compile", "maven-test-compile" );
         artifact = getArtifact( project, "maven-test-compile", "scope-runtime" );
-        assertEquals( "Check scope", "runtime", artifact.getScope() );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
+
+        // check transitive dependencies of default scope dependency
+        artifact = getArtifact( project, "maven-test-default", "scope-default" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive compile scope", "compile", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-default", "scope-test" );
+        assertNull( "Unexpected transitive dependency", artifact );
 
-        // check all transitive deps of a default dependency are compile scope, except for runtime and test
-        checkGroupIdScope( project, "compile", "maven-test-default" );
         artifact = getArtifact( project, "maven-test-default", "scope-runtime" );
-        assertEquals( "Check scope", "runtime", artifact.getScope() );
-    }
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
 
-    private void checkGroupIdScope( MavenProject project, String scopeValue, String groupId )
-    {
-        Artifact artifact;
-        artifact = getArtifact( project, groupId, "scope-compile" );
-        assertEquals( "Check scope", scopeValue, artifact.getScope() );
-        artifact = getArtifact( project, groupId, "scope-test" );
-        assertNull( "Check test dependency is not transitive", artifact );
-        artifact = getArtifact( project, groupId, "scope-provided" );
-        assertNull( "Check provided dependency is not transitive", artifact );
-        artifact = getArtifact( project, groupId, "scope-default" );
-        assertEquals( "Check scope", scopeValue, artifact.getScope() );
+        artifact = getArtifact( project, "maven-test-default", "scope-compile" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive compile scope", "compile", artifact.getScope() );
+
+        artifact = getArtifact( project, "maven-test-default", "scope-provided" );
+        assertNull( "Unexpected transitive dependency", artifact );
+
+        artifact = getArtifact( project, "maven-test-default", "scope-runtime" );
+        assertNotNull( "Expected transitive dependency", artifact );
+        assertEquals( "Expected transitive runtime scope", "runtime", artifact.getScope() );
     }
 
     private void checkArtifactIdScope( MavenProject project, String scope, String scopeValue )

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/resources/projects/scope/transitive-compile-dep.xml
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/resources/projects/scope/transitive-compile-dep.xml b/maven-compat/src/test/resources/projects/scope/transitive-compile-dep.xml
index 1161c69..558b53f 100644
--- a/maven-compat/src/test/resources/projects/scope/transitive-compile-dep.xml
+++ b/maven-compat/src/test/resources/projects/scope/transitive-compile-dep.xml
@@ -52,6 +52,12 @@ under the License.
       <version>1.0</version>
       <scope>compile</scope>
     </dependency>
-  </dependencies>
 
+    <dependency>
+      <groupId>maven-test-compile</groupId>
+      <artifactId>scope-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/resources/projects/scope/transitive-default-dep.xml
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/resources/projects/scope/transitive-default-dep.xml b/maven-compat/src/test/resources/projects/scope/transitive-default-dep.xml
index c904be0..20c186a 100644
--- a/maven-compat/src/test/resources/projects/scope/transitive-default-dep.xml
+++ b/maven-compat/src/test/resources/projects/scope/transitive-default-dep.xml
@@ -53,6 +53,11 @@ under the License.
       <scope>compile</scope>
     </dependency>
 
+    <dependency>
+      <groupId>maven-test-default</groupId>
+      <artifactId>scope-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
-
 </project>

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/resources/projects/scope/transitive-provided-dep.xml
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/resources/projects/scope/transitive-provided-dep.xml b/maven-compat/src/test/resources/projects/scope/transitive-provided-dep.xml
index b85669c..219218c 100644
--- a/maven-compat/src/test/resources/projects/scope/transitive-provided-dep.xml
+++ b/maven-compat/src/test/resources/projects/scope/transitive-provided-dep.xml
@@ -52,6 +52,12 @@ under the License.
       <version>1.0</version>
       <scope>compile</scope>
     </dependency>
-  </dependencies>
 
+    <dependency>
+      <groupId>maven-test-provided</groupId>
+      <artifactId>scope-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/resources/projects/scope/transitive-runtime-dep.xml
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/resources/projects/scope/transitive-runtime-dep.xml b/maven-compat/src/test/resources/projects/scope/transitive-runtime-dep.xml
index 921723c..c63852f 100644
--- a/maven-compat/src/test/resources/projects/scope/transitive-runtime-dep.xml
+++ b/maven-compat/src/test/resources/projects/scope/transitive-runtime-dep.xml
@@ -53,6 +53,11 @@ under the License.
       <scope>compile</scope>
     </dependency>
 
+    <dependency>
+      <groupId>maven-test-runtime</groupId>
+      <artifactId>scope-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
-
 </project>

http://git-wip-us.apache.org/repos/asf/maven/blob/bec76204/maven-compat/src/test/resources/projects/scope/transitive-test-dep.xml
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/resources/projects/scope/transitive-test-dep.xml b/maven-compat/src/test/resources/projects/scope/transitive-test-dep.xml
index ea2dde9..8230d58 100644
--- a/maven-compat/src/test/resources/projects/scope/transitive-test-dep.xml
+++ b/maven-compat/src/test/resources/projects/scope/transitive-test-dep.xml
@@ -53,6 +53,11 @@ under the License.
       <scope>compile</scope>
     </dependency>
 
+    <dependency>
+      <groupId>maven-test-test</groupId>
+      <artifactId>scope-provided</artifactId>
+      <version>1.0</version>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
-
 </project>


[5/6] maven git commit: [MNG-5761] Dependency management is not transitive.

Posted by sc...@apache.org.
[MNG-5761] Dependency management is not transitive.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/d7967a58
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/d7967a58
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/d7967a58

Branch: refs/heads/MNG-6006
Commit: d7967a587d734ff4ac3e8ea5586818bc02ba005d
Parents: 34eb39f
Author: Christian Schulte <sc...@apache.org>
Authored: Fri Jun 10 16:55:30 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Fri Jul 1 19:25:15 2016 +0200

----------------------------------------------------------------------
 .../maven/repository/internal/MavenRepositorySystemUtils.java    | 4 ++--
 .../apache/maven/artifact/AbstractArtifactComponentTestCase.java | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/d7967a58/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
----------------------------------------------------------------------
diff --git a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
index 3a98b2a..b0b0a8d 100644
--- a/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
+++ b/maven-aether-provider/src/main/java/org/apache/maven/repository/internal/MavenRepositorySystemUtils.java
@@ -33,7 +33,7 @@ import org.eclipse.aether.impl.MetadataGeneratorFactory;
 import org.eclipse.aether.impl.VersionRangeResolver;
 import org.eclipse.aether.impl.VersionResolver;
 import org.eclipse.aether.util.artifact.DefaultArtifactTypeRegistry;
-import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
+import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager;
 import org.eclipse.aether.util.graph.selector.AndDependencySelector;
 import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
 import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
@@ -95,7 +95,7 @@ public final class MavenRepositorySystemUtils
         DependencyTraverser depTraverser = new FatArtifactTraverser();
         session.setDependencyTraverser( depTraverser );
 
-        DependencyManager depManager = new ClassicDependencyManager();
+        DependencyManager depManager = new TransitiveDependencyManager();
         session.setDependencyManager( depManager );
 
         DependencySelector depFilter =

http://git-wip-us.apache.org/repos/asf/maven/blob/d7967a58/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java
----------------------------------------------------------------------
diff --git a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java
index 365acc4..73780c1 100644
--- a/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java
+++ b/maven-compat/src/test/java/org/apache/maven/artifact/AbstractArtifactComponentTestCase.java
@@ -39,7 +39,7 @@ import org.eclipse.aether.collection.DependencySelector;
 import org.eclipse.aether.collection.DependencyTraverser;
 import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
 import org.eclipse.aether.repository.LocalRepository;
-import org.eclipse.aether.util.graph.manager.ClassicDependencyManager;
+import org.eclipse.aether.util.graph.manager.TransitiveDependencyManager;
 import org.eclipse.aether.util.graph.selector.AndDependencySelector;
 import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector;
 import org.eclipse.aether.util.graph.selector.OptionalDependencySelector;
@@ -349,7 +349,7 @@ public abstract class AbstractArtifactComponentTestCase
         DependencyTraverser depTraverser = new FatArtifactTraverser();
         session.setDependencyTraverser( depTraverser );
 
-        DependencyManager depManager = new ClassicDependencyManager();
+        DependencyManager depManager = new TransitiveDependencyManager();
         session.setDependencyManager( depManager );
 
         DependencySelector depFilter = new AndDependencySelector( new ScopeDependencySelector( "test", "provided" ),


[2/6] maven git commit: [MNG-6055] Move the release profile out of Maven's core so it can be more easily changed.

Posted by sc...@apache.org.
[MNG-6055] Move the release profile out of Maven's core so it can be more easily changed.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/b15d8909
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/b15d8909
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/b15d8909

Branch: refs/heads/MNG-6006
Commit: b15d89090bfc66b295c4d7025770019cfa54307c
Parents: 15a9c32
Author: Christian Schulte <sc...@apache.org>
Authored: Thu Jun 30 21:20:40 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Thu Jun 30 21:20:40 2016 +0200

----------------------------------------------------------------------
 apache-maven/src/conf/settings.xml              | 54 +++++++++++++++++++-
 .../org/apache/maven/model/pom-4.0.0.xml        | 51 ------------------
 2 files changed, 52 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/b15d8909/apache-maven/src/conf/settings.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/settings.xml b/apache-maven/src/conf/settings.xml
index 8d903f2..ec9e264 100644
--- a/apache-maven/src/conf/settings.xml
+++ b/apache-maven/src/conf/settings.xml
@@ -281,11 +281,61 @@ under the License.
         </pluginRepository>
       </pluginRepositories>
     </profile>
+
+    <!--
+    | Release profile activated by the 'maven-release-plugin' when performing a release by default.
+    -->
+    <profile>
+      <id>release-profile</id>
+
+      <activation>
+        <property>
+          <name>performRelease</name>
+          <value>true</value>
+        </property>
+      </activation>
+
+      <build>
+        <plugins>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar-no-fork</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-javadocs</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-deploy-plugin</artifactId>
+            <configuration>
+              <updateReleaseInfo>true</updateReleaseInfo>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
   </profiles>
 
   <!-- activeProfiles
-   | List of profiles that are active for all builds.
-   |-->
+  | List of profiles that are active for all builds.
+  |-->
   <activeProfiles>
     <!--
     <activeProfile>alwaysActiveProfile</activeProfile>

http://git-wip-us.apache.org/repos/asf/maven/blob/b15d8909/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
index 7565dfb..e0f72d4 100644
--- a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
+++ b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
@@ -54,56 +54,5 @@ under the License.
   <reporting>
     <outputDirectory>${project.build.directory}/site</outputDirectory>
   </reporting>
-
-  <profiles>
-    <!-- NOTE: The release profile will be removed from future versions of the super POM -->
-    <profile>
-      <id>release-profile</id>
-
-      <activation>
-        <property>
-          <name>performRelease</name>
-          <value>true</value>
-        </property>
-      </activation>
-
-      <build>
-        <plugins>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-source-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-sources</id>
-                <goals>
-                  <goal>jar-no-fork</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-javadocs</id>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-deploy-plugin</artifactId>
-            <configuration>
-              <updateReleaseInfo>true</updateReleaseInfo>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
-  </profiles>
-
 </project>
 <!-- END SNIPPET: superpom -->


[3/6] maven git commit: [MNG-6055] Move the release profile out of Maven's core so it can be more easily changed.

Posted by sc...@apache.org.
[MNG-6055] Move the release profile out of Maven's core so it can be more easily changed.

o This reverts commit b15d89090bfc66b295c4d7025770019cfa54307c.


Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/c2018a47
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/c2018a47
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/c2018a47

Branch: refs/heads/MNG-6006
Commit: c2018a47e9cc10ae34b2726e36ad62523b6c1534
Parents: b15d890
Author: Christian Schulte <sc...@apache.org>
Authored: Fri Jul 1 07:10:51 2016 +0200
Committer: Christian Schulte <sc...@apache.org>
Committed: Fri Jul 1 07:12:07 2016 +0200

----------------------------------------------------------------------
 apache-maven/src/conf/settings.xml              | 54 +-------------------
 .../org/apache/maven/model/pom-4.0.0.xml        | 51 ++++++++++++++++++
 2 files changed, 53 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/c2018a47/apache-maven/src/conf/settings.xml
----------------------------------------------------------------------
diff --git a/apache-maven/src/conf/settings.xml b/apache-maven/src/conf/settings.xml
index ec9e264..8d903f2 100644
--- a/apache-maven/src/conf/settings.xml
+++ b/apache-maven/src/conf/settings.xml
@@ -281,61 +281,11 @@ under the License.
         </pluginRepository>
       </pluginRepositories>
     </profile>
-
-    <!--
-    | Release profile activated by the 'maven-release-plugin' when performing a release by default.
-    -->
-    <profile>
-      <id>release-profile</id>
-
-      <activation>
-        <property>
-          <name>performRelease</name>
-          <value>true</value>
-        </property>
-      </activation>
-
-      <build>
-        <plugins>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-source-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-sources</id>
-                <goals>
-                  <goal>jar-no-fork</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-javadoc-plugin</artifactId>
-            <executions>
-              <execution>
-                <id>attach-javadocs</id>
-                <goals>
-                  <goal>jar</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
-            <inherited>true</inherited>
-            <artifactId>maven-deploy-plugin</artifactId>
-            <configuration>
-              <updateReleaseInfo>true</updateReleaseInfo>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
   </profiles>
 
   <!-- activeProfiles
-  | List of profiles that are active for all builds.
-  |-->
+   | List of profiles that are active for all builds.
+   |-->
   <activeProfiles>
     <!--
     <activeProfile>alwaysActiveProfile</activeProfile>

http://git-wip-us.apache.org/repos/asf/maven/blob/c2018a47/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
index e0f72d4..7565dfb 100644
--- a/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
+++ b/maven-model-builder/src/main/resources/org/apache/maven/model/pom-4.0.0.xml
@@ -54,5 +54,56 @@ under the License.
   <reporting>
     <outputDirectory>${project.build.directory}/site</outputDirectory>
   </reporting>
+
+  <profiles>
+    <!-- NOTE: The release profile will be removed from future versions of the super POM -->
+    <profile>
+      <id>release-profile</id>
+
+      <activation>
+        <property>
+          <name>performRelease</name>
+          <value>true</value>
+        </property>
+      </activation>
+
+      <build>
+        <plugins>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-source-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-sources</id>
+                <goals>
+                  <goal>jar-no-fork</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-javadoc-plugin</artifactId>
+            <executions>
+              <execution>
+                <id>attach-javadocs</id>
+                <goals>
+                  <goal>jar</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+          <plugin>
+            <inherited>true</inherited>
+            <artifactId>maven-deploy-plugin</artifactId>
+            <configuration>
+              <updateReleaseInfo>true</updateReleaseInfo>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
+
 </project>
 <!-- END SNIPPET: superpom -->