upgraded parent pom
authorHerve Boutemy <hboutemy@apache.org>
Thu, 30 Oct 2014 05:51:47 +0000 (05:51 +0000)
committerHerve Boutemy <hboutemy@apache.org>
Thu, 30 Oct 2014 05:51:47 +0000 (05:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@1635388 13f79535-47bb-0310-9956-ffa450edef68

pom.xml
src/main/java/org/apache/maven/ProjectDependenciesResolver.java
src/main/java/org/apache/maven/shared/artifact/resolver/CumulativeScopeArtifactFilter.java
src/main/java/org/apache/maven/shared/artifact/resolver/DefaultProjectDependenciesResolver.java

diff --git a/pom.xml b/pom.xml
index 910e85d..be15a28 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@ under the License.
   <parent>
     <artifactId>maven-shared-components</artifactId>
     <groupId>org.apache.maven.shared</groupId>
-    <version>20</version>
+    <version>21</version>
     <relativePath>../maven-shared-components/pom.xml</relativePath>
   </parent>
 
index 94d2e7c..fbfa696 100644 (file)
@@ -23,7 +23,6 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.execution.MavenSession;
-import org.apache.maven.model.Dependency;
 import org.apache.maven.project.MavenProject;
 
 import java.util.Collection;
@@ -47,11 +46,11 @@ public interface ProjectDependenciesResolver
      * @param session Contains the local repository, along with other settings related to artifact resolution.
      * @return The set of resolved artifacts. If the projects contain no dependencies, this will return an empty set.
      * @throws ArtifactResolutionException In case {@link Artifact} instances cannot be created from 
-     *          project {@link Dependency} instances, or artifact resolution fails.
+     *          project {@link org.apache.maven.model.Dependency} instances, or artifact resolution fails.
      * @throws ArtifactNotFoundException In cases where one or more dependency artifacts cannot be found in the
      *          various repositories.
      */
-    public Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
+    Set<Artifact> resolve( Collection<? extends MavenProject> projects, Collection<String> scopes,
                                   MavenSession session )
         throws ArtifactResolutionException, ArtifactNotFoundException;
 
@@ -64,10 +63,10 @@ public interface ProjectDependenciesResolver
      * @param session Contains the local repository, along with other settings related to artifact resolution.
      * @return The set of resolved artifacts. If the project contains no dependencies, this will return an empty set.
      * @throws ArtifactResolutionException In case {@link Artifact} instances cannot be created from the
-     *          project {@link Dependency} instance, or artifact resolution fails.
+     *          project {@link org.apache.maven.model.Dependency} instance, or artifact resolution fails.
      * @throws ArtifactNotFoundException In cases where one or more dependency artifacts cannot be found in the
      *          various repositories.
      */
-    public Set<Artifact> resolve( MavenProject project, Collection<String> scopes, MavenSession session  )
+    Set<Artifact> resolve( MavenProject project, Collection<String> scopes, MavenSession session  )
         throws ArtifactResolutionException, ArtifactNotFoundException;
 }
index 42db8d9..bd0959d 100644 (file)
@@ -23,13 +23,12 @@ import java.util.Collection;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
 
 /**
  * Filter to only retain objects in the given scope or better. This implementation allows the 
  * accumulation of multiple scopes and their associated implied scopes, so that the user can filter
  * apply a series of implication rules in a single step. This should be a more efficient implementation
- * of multiple standard {@link ScopeArtifactFilter} instances ORed together.
+ * of multiple standard {@link org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter} instances ORed together.
  *
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
  * @author jdcasey
index 15aa92a..f49b979 100644 (file)
@@ -69,11 +69,13 @@ public final class DefaultProjectDependenciesResolver
     private ArtifactMetadataSource metadataSource;
     
     // for plexus instantiation.
-    public DefaultProjectDependenciesResolver(){}
+    public DefaultProjectDependenciesResolver()
+    {
+    }
 
     // for testing.
     DefaultProjectDependenciesResolver( ArtifactResolver resolver, ArtifactFactory artifactFactory,
-                                               ArtifactMetadataSource metadataSource )
+                                        ArtifactMetadataSource metadataSource )
     {
         this.resolver = resolver;
         this.artifactFactory = artifactFactory;
@@ -97,19 +99,19 @@ public final class DefaultProjectDependenciesResolver
 
         CumulativeScopeArtifactFilter scopeFilter = new CumulativeScopeArtifactFilter( scopes );
         
-        for ( MavenProject project : projects )
+        for ( MavenProject proj : projects )
         {
-            Set<Artifact> depArtifacts = project.getDependencyArtifacts();
+            Set<Artifact> depArtifacts = proj.getDependencyArtifacts();
             if ( depArtifacts == null )
             {
                 try
                 {
-                    depArtifacts = project.createArtifacts( artifactFactory, null, scopeFilter );
+                    depArtifacts = proj.createArtifacts( artifactFactory, null, scopeFilter );
                 }
                 catch ( InvalidDependencyVersionException e )
                 {
-                    throw new ArtifactResolutionException( "Failed to create Artifact instances for project dependencies: "
-                        + e.getMessage(), null, e );
+                    throw new ArtifactResolutionException( "Failed to create Artifact instances for project "
+                        + "dependencies: " + e.getMessage(), null, e );
                 }
             }
             
@@ -128,19 +130,19 @@ public final class DefaultProjectDependenciesResolver
                 }
             }
             
-            Artifact projectArtifact = project.getArtifact();
+            Artifact projectArtifact = proj.getArtifact();
             if ( projectArtifact == null )
             {
-                projectArtifact = artifactFactory.createProjectArtifact( project.getGroupId(), project.getArtifactId(),
-                                                                     project.getVersion() );
+                projectArtifact = artifactFactory.createProjectArtifact( proj.getGroupId(), proj.getArtifactId(),
+                                                                     proj.getVersion() );
             }
             
             try
             {
                 ArtifactResolutionResult result = resolver.resolveTransitively( depArtifacts, projectArtifact,
-                                                                                project.getManagedVersionMap(),
+                                                                                proj.getManagedVersionMap(),
                                                                                 session.getLocalRepository(),
-                                                                                project.getRemoteArtifactRepositories(),
+                                                                                proj.getRemoteArtifactRepositories(),
                                                                                 metadataSource, scopeFilter );
 
                 if ( result.getArtifacts() != null && !result.getArtifacts().isEmpty() )
@@ -179,7 +181,8 @@ public final class DefaultProjectDependenciesResolver
     /**
      * {@inheritDoc}
      */
-    public Set<Artifact> resolve( final MavenProject project, final Collection<String> scopes, final MavenSession session )
+    public Set<Artifact> resolve( final MavenProject project, final Collection<String> scopes,
+                                  final MavenSession session )
         throws ArtifactResolutionException, ArtifactNotFoundException
     {
         Collection<MavenProject> projects = Collections.singleton( project );