You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2009/05/08 05:25:09 UTC

svn commit: r772832 - in /maven/components/branches/MNG-2766: ./ apache-maven/ maven-compat/src/main/java/org/apache/maven/artifact/ maven-compat/src/main/java/org/apache/maven/artifact/factory/ maven-compat/src/main/java/org/apache/maven/artifact/meta...

Author: jvanzyl
Date: Fri May  8 03:24:55 2009
New Revision: 772832

URL: http://svn.apache.org/viewvc?rev=772832&view=rev
Log:
o in the middle of a ReactorArtifactRepository but ben and igor need access so checking in

Modified:
    maven/components/branches/MNG-2766/apache-maven/pom.xml
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepository.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
    maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
    maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/TestMavenRepositorySystem.java
    maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java
    maven/components/branches/MNG-2766/maven-embedder/pom.xml
    maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
    maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
    maven/components/branches/MNG-2766/maven-model-builder/src/main/java/org/apache/maven/model/DomainModel.java
    maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
    maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java
    maven/components/branches/MNG-2766/pom.xml

Modified: maven/components/branches/MNG-2766/apache-maven/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/apache-maven/pom.xml?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/apache-maven/pom.xml (original)
+++ maven/components/branches/MNG-2766/apache-maven/pom.xml Fri May  8 03:24:55 2009
@@ -23,11 +23,8 @@
     <artifactId>maven</artifactId>
     <version>3.0-SNAPSHOT</version>
   </parent>
-
   <artifactId>apache-maven</artifactId>
-
   <name>Maven Distribution</name>
-
   <dependencies>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -60,14 +57,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh-external</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-file</artifactId>
     </dependency>
   </dependencies>

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/DefaultArtifact.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/DefaultArtifact.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/DefaultArtifact.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/DefaultArtifact.java Fri May  8 03:24:55 2009
@@ -38,9 +38,7 @@
 import org.codehaus.plexus.util.StringUtils;
 
 /**
- * @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
- * @version $Id$
- * @todo this should possibly be replaced by type handler
+ * @author Jason van Zyl
  */
 public class DefaultArtifact
     implements Artifact

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java Fri May  8 03:24:55 2009
@@ -180,9 +180,8 @@
                                      String inheritedScope,
                                      boolean optional )
     {
-        // TODO: can refactor - inherited artifactScope calculation belongs in the collector, use artifactScope handler
-
         String desiredScope = Artifact.SCOPE_RUNTIME;
+        
         if ( inheritedScope == null )
         {
             desiredScope = scope;

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/metadata/ArtifactMetadataSource.java Fri May  8 03:24:55 2009
@@ -34,19 +34,7 @@
  */
 public interface ArtifactMetadataSource
 {
-    String ROLE = ArtifactMetadataSource.class.getName();
-
-    ResolutionGroup retrieve( Artifact artifact,
-                              ArtifactRepository localRepository,
-                              List<ArtifactRepository> remoteRepositories )
-        throws ArtifactMetadataRetrievalException;
-
-    /**
-     * Resolve all relocations in the POM for this artifact, and return the new artifact coordinate.
-     */
-    Artifact retrieveRelocatedArtifact( Artifact artifact,
-                                        ArtifactRepository localRepository,
-                                        List<ArtifactRepository> remoteRepositories )
+    ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
         throws ArtifactMetadataRetrievalException;
 
     /**
@@ -61,9 +49,7 @@
      * @throws ArtifactMetadataRetrievalException
      *          in case of error while retrieving repository metadata from the repository.
      */
-    List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact,
-                                    ArtifactRepository localRepository,
-                                    List<ArtifactRepository> remoteRepositories )
+    List<ArtifactVersion> retrieveAvailableVersions( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
         throws ArtifactMetadataRetrievalException;
 
     /**
@@ -79,7 +65,6 @@
      * @throws ArtifactMetadataRetrievalException
      *          in case of error while retrieving repository metadata from the repository.
      */
-    List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact,
-                                                                             ArtifactRepository localRepository,
-                                                                             ArtifactRepository remoteRepository ) throws ArtifactMetadataRetrievalException;
+    List<ArtifactVersion> retrieveAvailableVersionsFromDeploymentRepository( Artifact artifact, ArtifactRepository localRepository, ArtifactRepository remoteRepository )                                                                            
+        throws ArtifactMetadataRetrievalException;
 }
\ No newline at end of file

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepository.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepository.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepository.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/ArtifactRepository.java Fri May  8 03:24:55 2009
@@ -19,12 +19,6 @@
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 
-/**
- * Specifies the repository used for artifact handling.
- * 
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- * @version $Id$
- */
 public interface ArtifactRepository
 {
     String pathOf( Artifact artifact );
@@ -59,9 +53,11 @@
 
     String getKey();
 
-    boolean isUniqueVersion();
-
     void setBlacklisted( boolean blackListed );
 
     boolean isBlacklisted();
+    
+    // New interface methods for the repository system. 
+    
+    Artifact find( Artifact artifact );
 }

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/repository/DefaultArtifactRepository.java Fri May  8 03:24:55 2009
@@ -31,6 +31,7 @@
  * @author <a href="michal.maczka@dimatics.com">Michal Maczka </a>
  * @version $Id$
  */
+//TODO: this needs to be decoupled from Wagon
 public class DefaultArtifactRepository
     extends Repository
     implements ArtifactRepository
@@ -41,8 +42,6 @@
 
     private ArtifactRepositoryPolicy releases;
 
-    private boolean uniqueVersion = true;
-
     private boolean blacklisted;
 
     /**
@@ -69,7 +68,6 @@
     {
         super( id, url );
         this.layout = layout;
-        this.uniqueVersion = uniqueVersion;
     }
 
     /**
@@ -155,11 +153,6 @@
         return getId();
     }
 
-    public boolean isUniqueVersion()
-    {
-        return uniqueVersion;
-    }
-
     public boolean isBlacklisted()
     {
         return blacklisted;
@@ -184,4 +177,9 @@
 
         return sb.toString();
     }
+
+    public Artifact find( Artifact artifact )
+    {
+        return null;
+    }
 }

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactCollector.java Fri May  8 03:24:55 2009
@@ -512,13 +512,6 @@
                                     artifact.selectVersion( version.toString() );
                                     fireEvent( ResolutionListener.SELECT_VERSION_FROM_RANGE, listeners, child );
                                 }
-
-                                Artifact relocated = source.retrieveRelocatedArtifact( artifact, localRepository, childRemoteRepositories );
-                                if ( !artifact.equals( relocated ) )
-                                {
-                                    artifact = relocated;
-                                    child.setArtifact( artifact );
-                                }
                             }
                             while( !childKey.equals( child.getKey() ) );
 

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java Fri May  8 03:24:55 2009
@@ -455,7 +455,6 @@
             }
             catch ( ArtifactMetadataRetrievalException e )
             {
-                e.printStackTrace();
                 // need to add metadata resolution exception
                 return result;
             }

Modified: maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java (original)
+++ maven/components/branches/MNG-2766/maven-compat/src/main/java/org/apache/maven/artifact/transform/SnapshotTransformation.java Fri May  8 03:24:55 2009
@@ -95,10 +95,8 @@
         if ( artifact.isSnapshot() )
         {
             Snapshot snapshot = new Snapshot();
-            if ( remoteRepository.isUniqueVersion() )
-            {
-                snapshot.setTimestamp( getDeploymentTimestamp() );
-            }
+            
+            snapshot.setTimestamp( getDeploymentTimestamp() );
 
             // we update the build number anyway so that it doesn't get lost. It requires the timestamp to take effect
             try

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java Fri May  8 03:24:55 2009
@@ -508,6 +508,36 @@
                 
         return mojoDescriptor;
     }
+        
+    private static int count = 0;
+    
+    // org.apache.maven.plugins:maven-remote-resources-plugin:1.0:process
+    MojoDescriptor getMojoDescriptor( String groupId, String artifactId, String version, String goal, MavenProject project, ArtifactRepository localRepository )
+        throws LifecycleExecutionException
+    {        
+        Plugin plugin = new Plugin();
+        plugin.setGroupId( groupId );
+        plugin.setArtifactId( artifactId );
+        plugin.setVersion( version );        
+
+        MojoDescriptor mojoDescriptor;
+    
+        //need to do the active project thing as the site plugin is referencing itself
+        
+        if ( artifactId.equals( "maven-site-plugin" ) ){ count++; System.out.println( count ); };
+        
+        System.out.println( ">>> " + artifactId );
+        try
+        {
+            mojoDescriptor = pluginManager.getMojoDescriptor( plugin, goal, project, localRepository );
+        }
+        catch ( PluginLoaderException e )
+        {
+            throw new LifecycleExecutionException( "Error loading MojoDescriptor.", e );
+        }        
+                
+        return mojoDescriptor;
+    }    
     
     public void initialize()
         throws InitializationException
@@ -620,13 +650,13 @@
     public Set<Plugin> populateDefaultConfigurationForPlugins( Set<Plugin> plugins, MavenProject project, ArtifactRepository localRepository ) 
         throws LifecycleExecutionException
     {
-        for( Plugin p: plugins )
+        for( Plugin p : plugins )
         {
             for( PluginExecution e : p.getExecutions() )
             {
-                for( String g : e.getGoals() )
+                for( String goal : e.getGoals() )
                 {
-                    Xpp3Dom dom = getDefaultPluginConfiguration( p.getGroupId(), p.getArtifactId(), p.getVersion(), g, project, localRepository );
+                    Xpp3Dom dom = getDefaultPluginConfiguration( p.getGroupId(), p.getArtifactId(), p.getVersion(), goal, project, localRepository );
                     e.setConfiguration( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) e.getConfiguration(), dom, Boolean.TRUE ) );
                 }
             }
@@ -638,8 +668,7 @@
     public Xpp3Dom getDefaultPluginConfiguration( String groupId, String artifactId, String version, String goal, MavenProject project, ArtifactRepository localRepository ) 
         throws LifecycleExecutionException
     {
-        //return new Xpp3Dom( "configuration" );
-        return convert( getMojoDescriptor( groupId+":"+artifactId+":"+version+":"+goal, project, localRepository ) );
+        return convert( getMojoDescriptor( groupId, artifactId, version, goal, project, localRepository ) );
     }
     
     public Xpp3Dom getMojoConfiguration( MojoDescriptor mojoDescriptor )

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/plugin/DefaultPluginManager.java Fri May  8 03:24:55 2009
@@ -54,7 +54,6 @@
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.repository.RepositorySystem;
-import org.apache.maven.repository.VersionNotFoundException;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.classworlds.realm.ClassRealm;
 import org.codehaus.plexus.component.annotations.Component;
@@ -149,10 +148,6 @@
         {
             throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " + e.getMessage(), e );
         }
-//        catch ( InvalidPluginException e )
-//        {
-//            throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " + e.getMessage(), e );
-//        }
         catch ( PluginVersionResolutionException e )
         {
             throw new PluginLoaderException( plugin, "Failed to load plugin. Reason: " + e.getMessage(), e );
@@ -588,31 +583,16 @@
     {
         MavenProject project = session.getCurrentProject();
 
-        // TODO: such a call in MavenMetadataSource too - packaging not really the intention of type
         Artifact artifact = repositorySystem.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null, project.getPackaging() );
-
-        // TODO: we don't need to resolve over and over again, as long as we are sure that the parameters are the same
-        // check this with yourkit as a hot spot.
-        // Don't recreate if already created - for effeciency, and because clover plugin adds to it
-        if ( project.getDependencyArtifacts() == null )
-        {
-            // NOTE: Don't worry about covering this case with the error-reporter bindings...it's already handled by the project error reporter.
-            try
-            {
-                project.setDependencyArtifacts( repositorySystem.createArtifacts( project.getDependencies(), null, null, project ) );
-            }
-            catch ( VersionNotFoundException e )
-            {
-                throw new InvalidDependencyVersionException( e.getProjectId(), e.getDependency(), e.getPomFile(), e.getCauseException() );
-            }
-        }
-
+        
         ArtifactFilter filter = new ScopeArtifactFilter( scope );
 
         ArtifactResolutionRequest request = new ArtifactResolutionRequest()
             .setArtifact( artifact )
+            // Here the root is not resolved because we are presumably working with a project locally.
             .setResolveRoot( false )
-            .setArtifactDependencies( project.getDependencyArtifacts() )
+            .setResolveTransitively( true )
+            //.setArtifactDependencies( project.getDependencyArtifacts() )
             .setLocalRepository( session.getLocalRepository() )
             .setRemoteRepostories( project.getRemoteArtifactRepositories() )
             .setManagedVersionMap( project.getManagedVersionMap() )
@@ -622,6 +602,7 @@
 
         resolutionErrorHandler.throwErrors( request, result );
 
+        //TODO: this is wrong
         project.setArtifacts( result.getArtifacts() );
 
         ArtifactRepository localRepository = session.getLocalRepository();
@@ -698,11 +679,6 @@
     public MojoDescriptor getMojoDescriptor( Plugin plugin, String goal, MavenProject project, ArtifactRepository localRepository )
         throws PluginLoaderException
     {
-        if ( plugin.getVersion() == null )
-        {
-            throw new IllegalArgumentException( "plugin.version: null" );
-        }
-
         PluginDescriptor pluginDescriptor = loadPlugin( plugin, project, localRepository );
 
         MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );

Modified: maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Fri May  8 03:24:55 2009
@@ -20,7 +20,6 @@
 import java.io.Reader;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Properties;
@@ -71,26 +70,26 @@
 {
     @Requirement
     private Logger logger;
-    
+
     @Requirement
     private ModelValidator validator;
-    
+
     @Requirement
-    private LifecycleExecutor lifecycle;    
+    private LifecycleExecutor lifecycle;
 
     @Requirement
     private RepositorySystem repositorySystem;
 
     @Requirement
     List<ModelEventListener> listeners;
-    
+
     @Requirement
-    private Interpolator interpolator;    
-    
+    private Interpolator interpolator;
+
     @Requirement
-    private ResolutionErrorHandler resolutionErrorHandler;    
+    private ResolutionErrorHandler resolutionErrorHandler;
 
-    private static HashMap<String, MavenProject> hm = new HashMap<String, MavenProject>();
+    //private static HashMap<String, MavenProject> hm = new HashMap<String, MavenProject>();
 
     private MavenProject superProject;
 
@@ -98,100 +97,85 @@
     // MavenProjectBuilder Implementation
     // ----------------------------------------------------------------------
 
-    // This is used by the SITE plugin.
-    public MavenProject build( File project, ArtifactRepository localRepository, ProfileManager profileManager )
-        throws ProjectBuildingException
-    {
-        ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration()        
-            .setLocalRepository( localRepository )
-            .setGlobalProfileManager( profileManager );
-        
-        return build( project, configuration );
-    }
-
     public MavenProject build( File pomFile, ProjectBuilderConfiguration configuration )
         throws ProjectBuildingException
     {
-    	//Do inheritance
         DomainModel domainModel;
-		try 
-		{
-			domainModel = build( "unknown", pomFile, configuration );
-
-		} 
-		catch (IOException e) 
-		{
-			throw new ProjectBuildingException("", "", e);
-		}
 
-		//Profiles
+        try
+        {
+            domainModel = build( "unknown", pomFile, configuration );
+        }
+        catch ( IOException e )
+        {
+            throw new ProjectBuildingException( "", "", e );
+        }
+
+        //Profiles
 
         List<Profile> projectProfiles;
-	    Properties props = new Properties();
-	    props.putAll(configuration.getExecutionProperties());
+        Properties props = new Properties();
+        props.putAll( configuration.getExecutionProperties() );
 
         try
         {
-        	projectProfiles = DefaultProfileManager.getActiveProfilesFrom(configuration.getGlobalProfileManager(), props, domainModel.getModel() );
+            projectProfiles = DefaultProfileManager.getActiveProfilesFrom( configuration.getGlobalProfileManager(), props, domainModel.getModel() );
         }
         catch ( ProfileActivationException e )
         {
-            throw new ProjectBuildingException( "", "Failed to activate pom profiles.");
+            throw new ProjectBuildingException( "", "Failed to activate pom profiles." );
         }
-		
+
         try
         {
-        	List<Profile> externalProfiles = new ArrayList<Profile>();
-            for(Profile p : projectProfiles)
-    		{
-            	if(!"pom".equals(p.getSource()))
-            	{
-            		logger.debug("Merging profile into model (build): Model = " + domainModel.getId() + ", Profile = " + p.getId() );
-            		externalProfiles.add(p);
-            	}   			
-    		}
-    		        	
-            domainModel = ProcessorContext.mergeProfilesIntoModel( externalProfiles, domainModel );                
+            List<Profile> externalProfiles = new ArrayList<Profile>();
+            for ( Profile p : projectProfiles )
+            {
+                if ( !"pom".equals( p.getSource() ) )
+                {
+                    logger.debug( "Merging profile into model (build): Model = " + domainModel.getId() + ", Profile = " + p.getId() );
+                    externalProfiles.add( p );
+                }
+            }
+
+            domainModel = ProcessorContext.mergeProfilesIntoModel( externalProfiles, domainModel );
         }
         catch ( IOException e )
         {
-            throw new ProjectBuildingException("", "");
+            throw new ProjectBuildingException( "", "" );
         }
-   
+
         //Interpolation & Management
         MavenProject project;
-		try 
-		{		
-			Model model = interpolateDomainModel( domainModel, configuration, pomFile );
-				
-			List<Plugin> plns = new ArrayList<Plugin>();
-			
-			Set<Plugin> plugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles(model.getPackaging());
-
-			addPluginsToModel(model, plugins);			
-							
-			ProcessorContext.processManagementNodes(model);
-		 					
-			project = this.fromDomainModelToMavenProject(model, domainModel.getParentFile(), configuration, pomFile);
- 			
-			ArrayList<Plugin> pln = new ArrayList<Plugin>();
-			for(Plugin p : project.getModel().getBuild().getPlugins())
-			{
-				Plugin copy = new Plugin();
-				PluginProcessor.copy2(p, copy, true);	
-				pln.add(copy);
-			}
-		
+        try
+        {
+            Model model = interpolateDomainModel( domainModel, configuration, pomFile );
+
+            Set<Plugin> plugins = lifecycle.getPluginsBoundByDefaultToAllLifecycles( model.getPackaging() );
+
+            addPluginsToModel( model, plugins );
+
+            ProcessorContext.processManagementNodes( model );
+
+            project = this.fromDomainModelToMavenProject( model, domainModel.getParentFile(), configuration, pomFile );
+
+            Set<Plugin> pluginsFromProject = new HashSet<Plugin>();
+            for ( Plugin p : project.getModel().getBuild().getPlugins() )
+            {
+                Plugin copy = new Plugin();
+                PluginProcessor.copy2( p, copy, true );
+                pluginsFromProject.add( copy );
+            }
+
             // Merge the various sources for mojo configuration:
             // 1. default values from mojo descriptor
             // 2. POM values from per-plugin configuration
             // 3. POM values from per-execution configuration
             // These configuration sources are given in increasing order of dominance.
 
-			Set<Plugin> pl = lifecycle.populateDefaultConfigurationForPlugins(new HashSet<Plugin>(pln), 
-				project, configuration.getLocalRepository());
-		   		
-			for ( Plugin buildPlugin : pl )
+            Set<Plugin> processedPlugins = lifecycle.populateDefaultConfigurationForPlugins( pluginsFromProject, project, configuration.getLocalRepository() );
+
+            for ( Plugin buildPlugin : processedPlugins )
             {
                 Xpp3Dom dom = (Xpp3Dom) buildPlugin.getConfiguration();
                 Plugin x = containsPlugin( buildPlugin, project.getModel().getBuild().getPlugins() );
@@ -210,30 +194,27 @@
                             PluginExecution pe = contains( g, x.getExecutions() );
                             if ( pe != null )
                             {
-                                Xpp3Dom dom2 =
-                                    Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) pe.getConfiguration(),
-                                                          (Xpp3Dom) e.getConfiguration() );
+                                Xpp3Dom dom2 = Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) pe.getConfiguration(), (Xpp3Dom) e.getConfiguration() );
                                 e.setConfiguration( dom2 );
                             }
                         }
                     }
                 }
-
             }
-			
-			project.getModel().getBuild().setPlugins(new ArrayList<Plugin>(pl));
-		} 
-		catch (IOException e) 
-		{
-			throw new ProjectBuildingException("", "");
-		}
-		catch (LifecycleExecutionException e) 
-		{
-			e.printStackTrace();
-			throw new ProjectBuildingException("",e.getMessage());
-		}
-        project.setActiveProfiles( projectProfiles );
-         
+
+            project.getModel().getBuild().setPlugins( new ArrayList<Plugin>( processedPlugins ) );
+        }
+        catch ( IOException e )
+        {
+            throw new ProjectBuildingException( "", "" );
+        }
+        catch ( LifecycleExecutionException e )
+        {
+            throw new ProjectBuildingException( "", e.getMessage() );
+        }
+
+        //project.setActiveProfiles( projectProfiles );
+
         Build build = project.getBuild();
         // NOTE: setting this script-source root before path translation, because
         // the plugin tools compose basedir and scriptSourceRoot into a single file.
@@ -241,95 +222,15 @@
         project.addCompileSourceRoot( build.getSourceDirectory() );
         project.addTestCompileSourceRoot( build.getTestSourceDirectory() );
         project.setFile( pomFile );
-        
+
         setBuildOutputDirectoryOnParent( project );
 
-        hm.put( ArtifactUtils.artifactId( project.getGroupId(), project.getArtifactId(), "pom", project.getVersion() ), project );
-        
         return project;
     }
-    
-    private static PluginExecution contains(String goal, List<PluginExecution> plugins)
-    {
-    	for(PluginExecution pe : plugins)
-    	{
-    		if(pe.getGoals().contains(goal))
-    		{
-    			return pe;
-    		}
-    	}
-    	return null;
-    }
-    
-    public static void addPluginsToModel( Model target, Set<Plugin> plugins )
-    {
-    	List<Plugin> mngPlugins = (target.getBuild().getPluginManagement() != null)
-    		? target.getBuild().getPluginManagement().getPlugins() : new ArrayList<Plugin>();
-    		
-    	List<Plugin> pomPlugins = new ArrayList<Plugin>(target.getBuild().getPlugins());
-    	
-    	List<Plugin> lifecyclePlugins = new ArrayList<Plugin>();
-    	
-    	for( Plugin p : plugins )
-    	{
-    		//Go ahead and add version if exists in pluginManagement - don't use default version
-    		Plugin mngPlugin = containsPlugin(p, mngPlugins);
-    		if(mngPlugin != null && mngPlugin.getVersion() != null)
-    		{
-    			//System.out.println("Set version:" + p.getVersion() + ": To = " + mngPlugin.getVersion());
-    			p.setVersion(mngPlugin.getVersion());
-    		}
-    		
-    		Plugin pomPlugin = containsPlugin( p, pomPlugins);
-    		if ( pomPlugin == null )
-            {
-                lifecyclePlugins.add( p );
-            }
-            else
-            {
-                PluginProcessor.copy2( p, pomPlugin, true );
-                if ( p.getConfiguration() != null )
-                {
-                    System.out.println( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) p.getConfiguration(),
-                                                              (Xpp3Dom) pomPlugin.getConfiguration() ) );
-                }
-            }
-    	}
-    	pomPlugins.addAll(lifecyclePlugins);
-    	target.getBuild().setPlugins(pomPlugins);
-
-    }
-    
-    private static Plugin containsPlugin(Plugin plugin, List<Plugin> plugins)
-    {
-    	for(Plugin p : plugins)
-    	{
-    		if( p.getGroupId().equals(plugin.getGroupId()) && p.getArtifactId().equals(plugin.getArtifactId()))
-    		{
-    			return p;
-    		}
-    	}
-    	
-    	return null;
-    }    
 
-    
-    public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
-        throws ProjectBuildingException
-    {
-        return buildFromRepository( artifact, new DefaultProjectBuilderConfiguration( localRepository, remoteRepositories ) );
-    }
-    
     public MavenProject buildFromRepository( Artifact artifact, ProjectBuilderConfiguration configuration )
         throws ProjectBuildingException
     {
-        MavenProject project = hm.get( artifact.getId() );
-
-        if ( project != null )
-        {
-            return project;
-        }
-
         if ( !artifact.getType().equals( "pom" ) )
         {
             artifact = repositorySystem.createProjectArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion() );
@@ -346,62 +247,24 @@
         {
             throw new ProjectBuildingException( artifact.getId(), "Error resolving project artifact.", e );
         }
-        DomainModel domainModel;
-        try
-        {
-            domainModel = build( "unknown", artifact.getFile(), configuration );
-        }
-        catch ( IOException e )
-        {
-            throw new ProjectBuildingException( artifact.getId(), "Error reading project artifact.", e );
-        }
 
-        List<Profile> projectProfiles;
-        Properties props = new Properties();
-        props.putAll( configuration.getExecutionProperties() );
-        // props.putAll(configuration.getUserProperties());
-
-        try
-        {
-            projectProfiles = DefaultProfileManager.getActiveProfilesFrom( configuration.getGlobalProfileManager(), props, domainModel.getModel() );
-        }
-        catch ( ProfileActivationException e )
-        {
-            throw new ProjectBuildingException( "", "Failed to activate pom profiles." );
-        }
-
-        try
-        {
-            for ( Profile p : projectProfiles )
-            {
-                logger.debug( "Merging profile into model (buildFromRepository): Model = " + domainModel.getId() + ", Profile = " + p.getId() );
-            }
-
-            domainModel = ProcessorContext.mergeProfilesIntoModel( projectProfiles, domainModel );
-        }
-        catch ( IOException e )
-        {
-            throw new ProjectBuildingException( "", "" );
-        }
-
-        try
-        {
-            Model model = ProcessorContext.processManagementNodes( interpolateDomainModel( domainModel, configuration, artifact.getFile() ) );
-            project = this.fromDomainModelToMavenProject( model, domainModel.getParentFile(), configuration, artifact.getFile() );
-        }
-        catch ( IOException e )
-        {
-            throw new ProjectBuildingException( "", "" );
-        }
+        return build( artifact.getFile(), configuration );
+    }
 
-        project.setActiveProfiles( projectProfiles );
-        artifact.setFile( artifact.getFile() );
-        project.setVersion( artifact.getVersion() );
+    // This is used by the SITE plugin.
+    public MavenProject build( File project, ArtifactRepository localRepository, ProfileManager profileManager )
+        throws ProjectBuildingException
+    {
+        ProjectBuilderConfiguration configuration = new DefaultProjectBuilderConfiguration().setLocalRepository( localRepository ).setGlobalProfileManager( profileManager );
 
-        hm.put( artifact.getId(), project );
+        return build( project, configuration );
+    }
 
-        return project;
-    }    
+    public MavenProject buildFromRepository( Artifact artifact, List<ArtifactRepository> remoteRepositories, ArtifactRepository localRepository )
+        throws ProjectBuildingException
+    {
+        return buildFromRepository( artifact, new DefaultProjectBuilderConfiguration( localRepository, remoteRepositories ) );
+    }
 
     /**
      * This is used for pom-less execution like running archetype:generate.
@@ -440,27 +303,86 @@
         Artifact pomArtifact = repositorySystem.createProjectArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion() );
         pomArtifact.setFile( pomFile );
 
-        ArtifactResolutionRequest request = new ArtifactResolutionRequest()
-            .setArtifact( pomArtifact )
-            .setArtifactDependencies( project.getDependencyArtifacts() )
-            .setLocalRepository( configuration.getLocalRepository() )
-            .setRemoteRepostories( project.getRemoteArtifactRepositories() )
-            .setManagedVersionMap( project.getManagedVersionMap() );
-               
+        ArtifactResolutionRequest request = new ArtifactResolutionRequest().setArtifact( pomArtifact ).setArtifactDependencies( project.getDependencyArtifacts() )
+            .setLocalRepository( configuration.getLocalRepository() ).setRemoteRepostories( project.getRemoteArtifactRepositories() ).setManagedVersionMap( project.getManagedVersionMap() );
+
         ArtifactResolutionResult result = repositorySystem.resolve( request );
 
         if ( result.hasExceptions() )
         {
             Exception e = result.getExceptions().get( 0 );
 
-            throw new ProjectBuildingException( safeVersionlessKey( project.getGroupId(), project.getArtifactId() ), "Unable to build project due to an invalid dependency version: " + e.getMessage(), pomFile, e );
+            throw new ProjectBuildingException( safeVersionlessKey( project.getGroupId(), project.getArtifactId() ), "Unable to build project due to an invalid dependency version: " + e.getMessage(),
+                                                pomFile, e );
         }
 
         project.setArtifacts( result.getArtifacts() );
 
         return new MavenProjectBuildingResult( project, result );
     }
-    
+
+    private static PluginExecution contains( String goal, List<PluginExecution> plugins )
+    {
+        for ( PluginExecution pe : plugins )
+        {
+            if ( pe.getGoals().contains( goal ) )
+            {
+                return pe;
+            }
+        }
+        return null;
+    }
+
+    public static void addPluginsToModel( Model target, Set<Plugin> plugins )
+    {
+        List<Plugin> mngPlugins = ( target.getBuild().getPluginManagement() != null ) ? target.getBuild().getPluginManagement().getPlugins() : new ArrayList<Plugin>();
+
+        List<Plugin> pomPlugins = new ArrayList<Plugin>( target.getBuild().getPlugins() );
+
+        List<Plugin> lifecyclePlugins = new ArrayList<Plugin>();
+
+        for ( Plugin p : plugins )
+        {
+            //Go ahead and add version if exists in pluginManagement - don't use default version
+            Plugin mngPlugin = containsPlugin( p, mngPlugins );
+            if ( mngPlugin != null && mngPlugin.getVersion() != null )
+            {
+                //System.out.println("Set version:" + p.getVersion() + ": To = " + mngPlugin.getVersion());
+                p.setVersion( mngPlugin.getVersion() );
+            }
+
+            Plugin pomPlugin = containsPlugin( p, pomPlugins );
+            if ( pomPlugin == null )
+            {
+                lifecyclePlugins.add( p );
+            }
+            else
+            {
+                PluginProcessor.copy2( p, pomPlugin, true );
+                if ( p.getConfiguration() != null )
+                {
+                    System.out.println( Xpp3Dom.mergeXpp3Dom( (Xpp3Dom) p.getConfiguration(), (Xpp3Dom) pomPlugin.getConfiguration() ) );
+                }
+            }
+        }
+        pomPlugins.addAll( lifecyclePlugins );
+        target.getBuild().setPlugins( pomPlugins );
+
+    }
+
+    private static Plugin containsPlugin( Plugin plugin, List<Plugin> plugins )
+    {
+        for ( Plugin p : plugins )
+        {
+            if ( p.getGroupId().equals( plugin.getGroupId() ) && p.getArtifactId().equals( plugin.getArtifactId() ) )
+            {
+                return p;
+            }
+        }
+
+        return null;
+    }
+
     private Model interpolateDomainModel( DomainModel domainModel, ProjectBuilderConfiguration config, File projectDescriptor )
         throws ProjectBuildingException
     {
@@ -474,15 +396,14 @@
         }
         catch ( IOException e )
         {
-
             throw new ProjectBuildingException( projectId, "", projectDescriptor, e );
         }
 
         return model;
     }
-    
-    private MavenProject fromDomainModelToMavenProject(Model model, File parentFile, ProjectBuilderConfiguration config, File projectDescriptor)
-    	throws InvalidProjectModelException, IOException
+
+    private MavenProject fromDomainModelToMavenProject( Model model, File parentFile, ProjectBuilderConfiguration config, File projectDescriptor )
+        throws InvalidProjectModelException, IOException
     {
         MavenProject project;
         String projectId = safeVersionlessKey( model.getGroupId(), model.getArtifactId() );
@@ -503,9 +424,9 @@
             throw new InvalidProjectModelException( projectId, e.getMessage(), projectDescriptor, e );
         }
 
-        return project;   	
+        return project;
     }
-    
+
     private DomainModel build( String projectId, File pomFile, ProjectBuilderConfiguration projectBuilderConfiguration )
         throws ProjectBuildingException, IOException
     {
@@ -515,97 +436,97 @@
         List<String> inactiveProfileIds = ( projectBuilderConfiguration != null && projectBuilderConfiguration.getGlobalProfileManager() != null && projectBuilderConfiguration
             .getGlobalProfileManager().getProfileActivationContext() != null ) ? projectBuilderConfiguration.getGlobalProfileManager().getProfileActivationContext().getExplicitlyInactiveProfileIds()
                                                                               : new ArrayList<String>();
-            
-            ProfileManagerInfo profileInfo = new ProfileManagerInfo(projectBuilderConfiguration.getExecutionProperties(), activeProfileIds, inactiveProfileIds);
-            DomainModel domainModel = new DomainModel( pomFile );
-            domainModel.setProjectDirectory( pomFile.getParentFile() );
-            domainModel.setMostSpecialized( true );
-
-            List<DomainModel> domainModels = new ArrayList<DomainModel>();
-
-            domainModels.add( domainModel );
-            ArtifactRepository localRepository = projectBuilderConfiguration.getLocalRepository();
-            List<ArtifactRepository> remoteRepositories = projectBuilderConfiguration.getRemoteRepositories();
-
-            File parentFile = null;
-            int lineageCount = 0;
-            if ( domainModel.getParentId() != null )
-            {
-            	List<DomainModel> mavenParents;
-            	MavenProject topProject = projectBuilderConfiguration.getTopLevelProjectFromReactor();
-            	if(useTopLevelProjectForParent(domainModel, topProject) )
-            	{
-            		mavenParents = getDomainModelParentsFromLocalPath( domainModel, localRepository, remoteRepositories, topProject.getFile(), projectBuilderConfiguration );
-            	}
-            	else if ( isParentLocal( domainModel.getRelativePathOfParent(), pomFile.getParentFile() ) )
-            	{
-            		mavenParents = getDomainModelParentsFromLocalPath( domainModel, localRepository, remoteRepositories, pomFile.getParentFile(), projectBuilderConfiguration );
-            	}
-            	else
-            	{
-            		mavenParents = getDomainModelParentsFromRepository( domainModel, localRepository, remoteRepositories );
-            	}
-
-            	if ( mavenParents.size() > 0 )
-            	{
-            		DomainModel dm = (DomainModel) mavenParents.get( 0 );
-            		parentFile = dm.getFile();
-            		domainModel.setParentFile( parentFile );
-            		lineageCount = mavenParents.size();
-            	}
-
-            	domainModels.addAll( mavenParents );
-            }
-
-            domainModels.add( new DomainModel( getSuperModel(), false ) );
-            List<DomainModel> profileModels = new ArrayList<DomainModel>();
-            //Process Profiles
-            for(DomainModel domain : domainModels)
-            {
-            	DomainModel dm = (DomainModel) domain;
-
-            	if(!dm.getModel().getProfiles().isEmpty())
-            	{
-            		Collection<Profile> profiles = DefaultProfileManager.getActiveProfiles(dm.getModel().getProfiles(), profileInfo);
-            		if(!profiles.isEmpty())
-            		{
-            			for(Profile p : profiles)
-            			{
-            				logger.debug("Merging profile into model: Model = " + dm.getId() + ", Profile = " + p.getId() );
-            			}
-            			profileModels.add(ProcessorContext.mergeProfilesIntoModel( profiles, dm ));  
-            		}
-            		else
-            		{
-            			profileModels.add( dm );   
-            		}
-            	}
-            	else
-            	{
-            		profileModels.add( dm );
-            	}                
-            }
-
-            DomainModel transformedDomainModel = ProcessorContext.build(profileModels, listeners);
-
-            // Lineage count is inclusive to add the POM read in itself.
-            transformedDomainModel.setLineageCount( lineageCount + 1 );
-            transformedDomainModel.setParentFile( parentFile );
-
-            return transformedDomainModel;
-    }
-    
-    private static boolean useTopLevelProjectForParent(DomainModel currentModel, MavenProject topProject) throws IOException
-    {
-    	if(topProject == null || currentModel.getModel().getParent() == null)
-    	{
-    		return false;
-    	}
-
-    	return topProject.getGroupId().equals(currentModel.getParentGroupId()) 
-    	&& topProject.getArtifactId().equals(currentModel.getParentArtifactId()) 
-    	&& topProject.getVersion().equals(currentModel.getParentVersion());
-    	
+
+        ProfileManagerInfo profileInfo = new ProfileManagerInfo( projectBuilderConfiguration.getExecutionProperties(), activeProfileIds, inactiveProfileIds );
+        DomainModel domainModel = new DomainModel( pomFile );
+        domainModel.setProjectDirectory( pomFile.getParentFile() );
+        domainModel.setMostSpecialized( true );
+
+        List<DomainModel> domainModels = new ArrayList<DomainModel>();
+
+        domainModels.add( domainModel );
+        ArtifactRepository localRepository = projectBuilderConfiguration.getLocalRepository();
+        List<ArtifactRepository> remoteRepositories = projectBuilderConfiguration.getRemoteRepositories();
+
+        File parentFile = null;
+        int lineageCount = 0;
+        if ( domainModel.getParentId() != null )
+        {
+            List<DomainModel> mavenParents;
+            MavenProject topProject = projectBuilderConfiguration.getTopLevelProjectFromReactor();
+            if ( useTopLevelProjectForParent( domainModel, topProject ) )
+            {
+                mavenParents = getDomainModelParentsFromLocalPath( domainModel, localRepository, remoteRepositories, topProject.getFile(), projectBuilderConfiguration );
+            }
+            else if ( isParentLocal( domainModel.getRelativePathOfParent(), pomFile.getParentFile() ) )
+            {
+                mavenParents = getDomainModelParentsFromLocalPath( domainModel, localRepository, remoteRepositories, pomFile.getParentFile(), projectBuilderConfiguration );
+            }
+            else
+            {
+                mavenParents = getDomainModelParentsFromRepository( domainModel, localRepository, remoteRepositories );
+            }
+
+            if ( mavenParents.size() > 0 )
+            {
+                DomainModel dm = (DomainModel) mavenParents.get( 0 );
+                parentFile = dm.getFile();
+                domainModel.setParentFile( parentFile );
+                lineageCount = mavenParents.size();
+            }
+
+            domainModels.addAll( mavenParents );
+        }
+
+        domainModels.add( new DomainModel( getSuperModel(), false ) );
+        List<DomainModel> profileModels = new ArrayList<DomainModel>();
+        //Process Profiles
+        for ( DomainModel domain : domainModels )
+        {
+            DomainModel dm = (DomainModel) domain;
+
+            if ( !dm.getModel().getProfiles().isEmpty() )
+            {
+                Collection<Profile> profiles = DefaultProfileManager.getActiveProfiles( dm.getModel().getProfiles(), profileInfo );
+                if ( !profiles.isEmpty() )
+                {
+                    for ( Profile p : profiles )
+                    {
+                        logger.debug( "Merging profile into model: Model = " + dm.getId() + ", Profile = " + p.getId() );
+                    }
+                    profileModels.add( ProcessorContext.mergeProfilesIntoModel( profiles, dm ) );
+                }
+                else
+                {
+                    profileModels.add( dm );
+                }
+            }
+            else
+            {
+                profileModels.add( dm );
+            }
+        }
+
+        DomainModel transformedDomainModel = ProcessorContext.build( profileModels, listeners );
+
+        // Lineage count is inclusive to add the POM read in itself.
+        transformedDomainModel.setLineageCount( lineageCount + 1 );
+        transformedDomainModel.setParentFile( parentFile );
+
+        return transformedDomainModel;
+    }
+
+    private static boolean useTopLevelProjectForParent( DomainModel currentModel, MavenProject topProject )
+        throws IOException
+    {
+        if ( topProject == null || currentModel.getModel().getParent() == null )
+        {
+            return false;
+        }
+
+        return topProject.getGroupId().equals( currentModel.getParentGroupId() ) && topProject.getArtifactId().equals( currentModel.getParentArtifactId() )
+            && topProject.getVersion().equals( currentModel.getParentVersion() );
+
     }
 
     private void validateModel( Model model, File pomFile )
@@ -683,14 +604,14 @@
         }
     }
 
-    private List<DomainModel> getDomainModelParentsFromRepository(  DomainModel domainModel, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
+    private List<DomainModel> getDomainModelParentsFromRepository( DomainModel domainModel, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
         throws IOException
     {
         List<DomainModel> domainModels = new ArrayList<DomainModel>();
 
         String parentId = domainModel.getParentId();
 
-        if ( parentId == null || localRepository == null)
+        if ( parentId == null || localRepository == null )
         {
             return domainModels;
         }
@@ -699,24 +620,22 @@
 
         ArtifactResolutionRequest request = new ArtifactResolutionRequest( artifactParent, localRepository, remoteRepositories );
         ArtifactResolutionResult result;
-		try 
-		{
-			result = repositorySystem.resolve( request );
-		} 
-		catch (Exception e) 
-		{
-            throw (IOException) new IOException( "The parent POM " + artifactParent
-                    + " could not be retrieved from any repository" ).initCause( e );
-		}
-		
+        try
+        {
+            result = repositorySystem.resolve( request );
+        }
+        catch ( Exception e )
+        {
+            throw (IOException) new IOException( "The parent POM " + artifactParent + " could not be retrieved from any repository" ).initCause( e );
+        }
+
         try
         {
             resolutionErrorHandler.throwErrors( request, result );
         }
         catch ( ArtifactResolutionException e )
         {
-            throw (IOException) new IOException( "The parent POM " + artifactParent
-                + " could not be retrieved from any repository" ).initCause( e );
+            throw (IOException) new IOException( "The parent POM " + artifactParent + " could not be retrieved from any repository" ).initCause( e );
         }
 
         DomainModel parentDomainModel = new DomainModel( artifactParent.getFile() );
@@ -726,7 +645,7 @@
             //shane: what does this mean exactly and why does it occur
             logger.debug( "Parent pom ids do not match: Parent File = " + artifactParent.getFile().getAbsolutePath() + ": Child ID = " + domainModel.getId() );
 
-           // return domainModels;
+            // return domainModels;
         }
 
         domainModels.add( parentDomainModel );
@@ -744,8 +663,8 @@
      * @return
      * @throws IOException
      */
-    private List<DomainModel> getDomainModelParentsFromLocalPath( DomainModel domainModel, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories,
-                                                                  File projectDirectory, ProjectBuilderConfiguration projectBuilderConfiguration )
+    private List<DomainModel> getDomainModelParentsFromLocalPath( DomainModel domainModel, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories, File projectDirectory,
+                                                                  ProjectBuilderConfiguration projectBuilderConfiguration )
         throws IOException
     {
         List<DomainModel> domainModels = new ArrayList<DomainModel>();
@@ -756,27 +675,27 @@
         {
             return domainModels;
         }
-        
+
         File parentFile = new File( projectDirectory, domainModel.getRelativePathOfParent() ).getCanonicalFile();
         if ( parentFile.isDirectory() )
         {
             parentFile = new File( parentFile.getAbsolutePath(), "pom.xml" );
         }
-    	MavenProject topProject = projectBuilderConfiguration.getTopLevelProjectFromReactor();
-    	boolean isTop = useTopLevelProjectForParent(domainModel, topProject);
-    	DomainModel parentDomainModel = null;
-        if ( !isTop  )
-        {
-        	if(!parentFile.isFile())
-        	{
-        		throw new IOException( "File does not exist: File = " + parentFile.getAbsolutePath() );	
-        	}     
-        	parentDomainModel = new DomainModel( parentFile );
-        	parentDomainModel.setProjectDirectory( parentFile.getParentFile() );
+        MavenProject topProject = projectBuilderConfiguration.getTopLevelProjectFromReactor();
+        boolean isTop = useTopLevelProjectForParent( domainModel, topProject );
+        DomainModel parentDomainModel = null;
+        if ( !isTop )
+        {
+            if ( !parentFile.isFile() )
+            {
+                throw new IOException( "File does not exist: File = " + parentFile.getAbsolutePath() );
+            }
+            parentDomainModel = new DomainModel( parentFile );
+            parentDomainModel.setProjectDirectory( parentFile.getParentFile() );
         }
         else
         {
-        	parentDomainModel = new DomainModel(projectBuilderConfiguration.getTopLevelProjectFromReactor().getFile());
+            parentDomainModel = new DomainModel( projectBuilderConfiguration.getTopLevelProjectFromReactor().getFile() );
         }
 
         if ( !parentDomainModel.matchesParentOf( domainModel ) )
@@ -798,18 +717,19 @@
         domainModels.add( parentDomainModel );
         if ( domainModel.getParentId() != null )
         {
-        	if(isTop)
-        	{
-        		 if ( isParentLocal( parentDomainModel.getRelativePathOfParent(), parentFile.getParentFile() ) )
-                 {
-        			 domainModels.addAll( getDomainModelParentsFromLocalPath( parentDomainModel, localRepository, remoteRepositories, topProject.getFile().getParentFile(), projectBuilderConfiguration ) );
-                 }
-                 else
-                 {
-                     domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, localRepository, remoteRepositories ) );
-                 }       		
-        	}
-        	else if ( isParentLocal( parentDomainModel.getRelativePathOfParent(), parentFile.getParentFile() ) )
+            if ( isTop )
+            {
+                if ( isParentLocal( parentDomainModel.getRelativePathOfParent(), parentFile.getParentFile() ) )
+                {
+                    domainModels
+                        .addAll( getDomainModelParentsFromLocalPath( parentDomainModel, localRepository, remoteRepositories, topProject.getFile().getParentFile(), projectBuilderConfiguration ) );
+                }
+                else
+                {
+                    domainModels.addAll( getDomainModelParentsFromRepository( parentDomainModel, localRepository, remoteRepositories ) );
+                }
+            }
+            else if ( isParentLocal( parentDomainModel.getRelativePathOfParent(), parentFile.getParentFile() ) )
             {
                 domainModels.addAll( getDomainModelParentsFromLocalPath( parentDomainModel, localRepository, remoteRepositories, parentFile.getParentFile(), projectBuilderConfiguration ) );
             }

Modified: maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/TestMavenRepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/TestMavenRepositorySystem.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/TestMavenRepositorySystem.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/TestMavenRepositorySystem.java Fri May  8 03:24:55 2009
@@ -1,75 +1,11 @@
 package org.apache.maven.project;
 
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.artifact.metadata.ResolutionGroup;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
 import org.apache.maven.repository.LegacyRepositorySystem;
 import org.apache.maven.repository.RepositorySystem;
-import org.apache.maven.repository.VersionNotFoundException;
 import org.codehaus.plexus.component.annotations.Component;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 @Component(role = RepositorySystem.class, hint = "test")
 public class TestMavenRepositorySystem
     extends LegacyRepositorySystem
 {
-    public ResolutionGroup retrieve( Artifact artifact, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )
-        throws ArtifactMetadataRetrievalException
-    {
-        Model model = null;
-        InputStreamReader r = null;
-        try
-        {
-            String scope = artifact.getArtifactId().substring( "scope-".length() );
-            if ( "maven-test".equals( artifact.getGroupId() ) )
-            {
-                String name = "/projects/scope/transitive-" + scope + "-dep.xml";
-                r = new InputStreamReader( getClass().getResourceAsStream( name ) );
-                MavenXpp3Reader reader = new MavenXpp3Reader();
-                model = reader.read( r );
-            }
-            else
-            {
-                model = new Model();
-            }
-            model.setGroupId( artifact.getGroupId() );
-            model.setArtifactId( artifact.getArtifactId() );
-        }
-        catch ( IOException e )
-        {
-            throw new ArtifactMetadataRetrievalException( e );
-        }
-        catch ( XmlPullParserException e )
-        {
-            throw new ArtifactMetadataRetrievalException( e );
-        }
-        finally
-        {
-            IOUtil.close( r );
-        }
-
-        Set artifacts;
-        try
-        {
-            artifacts = createArtifacts( model.getDependencies(), artifact.getScope(), null, null );
-        }
-        catch ( VersionNotFoundException e )
-        {
-            InvalidDependencyVersionException ee = new InvalidDependencyVersionException(e.getProjectId(), e.getDependency(),e.getPomFile(), e.getCauseException() );
-            
-            throw new ArtifactMetadataRetrievalException( ee );
-        }
-
-        return new ResolutionGroup( artifact, artifacts, remoteRepositories );
-    }
 }

Modified: maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java (original)
+++ maven/components/branches/MNG-2766/maven-core/src/test/java/org/apache/maven/project/artifact/MavenMetadataSourceTest.java Fri May  8 03:24:55 2009
@@ -81,7 +81,7 @@
         
         MavenProject project = new MavenProject( new Model() );
         
-        Set result = repositorySystem.createArtifacts( deps, null, dependencyFilter, project );
+        Set result = project.createArtifacts( dependencyFilter );
         
         for ( Iterator it = result.iterator(); it.hasNext(); )
         {
@@ -96,6 +96,8 @@
         }
     }
 
+    //TODO: restore these if it makes sense
+    /*
     public void testShouldUseCompileScopeIfDependencyScopeEmpty()
         throws Exception
     {
@@ -112,9 +114,9 @@
 
         model.addDependency( dep );
 
-        MavenProject project = new MavenProject( model );
+        MavenProject project = new MavenProject( model, repositorySystem );
 
-        project.setArtifacts( repositorySystem.createArtifacts( project.getDependencies(), null, null, project ) );
+        project.setArtifacts( project.createArtifacts( null ) );
 
         String key = ArtifactUtils.versionlessKey( groupId, artifactId );
 
@@ -159,13 +161,13 @@
 
         model.setDependencyManagement( depMgmt );
 
-        MavenProject project = new MavenProject( model );
+        MavenProject project = new MavenProject( model, repositorySystem );
 
         TestModelDefaultsInjector injector = new TestModelDefaultsInjector();
 
         injector.injectDefaults( model );
-
-        project.setArtifacts( repositorySystem.createArtifacts( project.getDependencies(), null, null, project ) );
+        
+        project.setArtifacts( project.createArtifacts( null ) );
         
         String key = ArtifactUtils.versionlessKey( groupId, artifactId );
 
@@ -182,5 +184,6 @@
         //check for back-propagation of default scope.
         assertEquals( "default scope NOT back-propagated to dependency.", Artifact.SCOPE_TEST, dep.getScope() );
     }
+    */
 
 }

Modified: maven/components/branches/MNG-2766/maven-embedder/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-embedder/pom.xml?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-embedder/pom.xml (original)
+++ maven/components/branches/MNG-2766/maven-embedder/pom.xml Fri May  8 03:24:55 2009
@@ -51,14 +51,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-ssh-external</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
       <artifactId>wagon-file</artifactId>
     </dependency>
     <dependency>

Modified: maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java (original)
+++ maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/MavenEmbedder.java Fri May  8 03:24:55 2009
@@ -38,7 +38,6 @@
 import org.apache.maven.model.Model;
 import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.plugin.PluginLoaderException;
 import org.apache.maven.plugin.PluginManager;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
@@ -269,18 +268,6 @@
         }
     }
 
-    /**
-     * mkleint: protected so that IDE integrations can selectively allow downloading artifacts
-     * from remote repositories (if they prohibit by default on project loading)
-     * @throws PluginLoaderException 
-    protected void verifyPlugin( Plugin plugin, MavenProject project )
-        throws ComponentLookupException, PluginLoaderException
-    {
-        MavenSession session = new MavenSession( request );
-        pluginManager.loadPlugin( plugin, project, session );
-    }
-     */
-
     // ----------------------------------------------------------------------
     // Project
     // ----------------------------------------------------------------------

Modified: maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java (original)
+++ maven/components/branches/MNG-2766/maven-embedder/src/main/java/org/apache/maven/embedder/execution/DefaultMavenExecutionRequestPopulator.java Fri May  8 03:24:55 2009
@@ -90,8 +90,6 @@
 
         toolchains( request, configuration );
 
-        artifactTransferMechanism( request, configuration );
-
         profileManager( request, configuration );
 
         processSettings( request, configuration );
@@ -342,27 +340,6 @@
     // Artifact Transfer Mechanism
     // ------------------------------------------------------------------------
 
-    private void artifactTransferMechanism( MavenExecutionRequest request, Configuration configuration )
-        throws MavenEmbedderException
-    {
-        // ------------------------------------------------------------------------
-        // Artifact Transfer Mechanism
-        // ------------------------------------------------------------------------
-
-        if ( request.isOffline() )
-        {
-            repositorySystem.setOnline( false );
-        }
-        else if ( ( request.getSettings() != null ) && request.getSettings().isOffline() )
-        {
-            repositorySystem.setOnline( false );
-        }
-        else
-        {
-            repositorySystem.setOnline( true );
-        }
-    }
-
     public ArtifactRepository createLocalRepository( MavenExecutionRequest request, Settings settings, Configuration configuration )
         throws MavenEmbedderException
     {

Modified: maven/components/branches/MNG-2766/maven-model-builder/src/main/java/org/apache/maven/model/DomainModel.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-model-builder/src/main/java/org/apache/maven/model/DomainModel.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-model-builder/src/main/java/org/apache/maven/model/DomainModel.java (original)
+++ maven/components/branches/MNG-2766/maven-model-builder/src/main/java/org/apache/maven/model/DomainModel.java Fri May  8 03:24:55 2009
@@ -39,7 +39,7 @@
     
     protected Model model;
 
-    public Model getModel() throws IOException
+    public Model getModel()
     {
         return model;        
     }   

Modified: maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java (original)
+++ maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java Fri May  8 03:24:55 2009
@@ -34,6 +34,7 @@
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.ArtifactRepositoryPolicy;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
+import org.apache.maven.artifact.resolver.ArtifactCollector;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
@@ -77,6 +78,9 @@
     private ArtifactRepositoryLayout defaultArtifactRepositoryLayout;
 
     @Requirement
+    private ArtifactCollector artifactCollector;
+    
+    @Requirement
     private MirrorBuilder mirrorBuilder;
 
     private Map<String, ProxyInfo> proxies = new HashMap<String, ProxyInfo>();
@@ -157,118 +161,15 @@
         return artifactFactory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifactId(), versionRange );
     }
 
-    /**
-     * @return {@link Set} &lt; {@link Artifact} >
-     * @todo desperately needs refactoring. It's just here because it's implementation is
-     *       maven-project specific
-     */
-    public Set<Artifact> createArtifacts( List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenRepositoryWrapper reactor )
-        throws VersionNotFoundException
-    {
-        return createArtifacts( artifactFactory, dependencies, inheritedScope, dependencyFilter, reactor );
-    }
-
-    @Deprecated
-    public static Set<Artifact> createArtifacts( ArtifactFactory artifactFactory, List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenRepositoryWrapper reactor )
-        throws VersionNotFoundException
-    {
-        Set<Artifact> projectArtifacts = new LinkedHashSet<Artifact>( dependencies.size() );
-
-        for ( Iterator<Dependency> i = dependencies.iterator(); i.hasNext(); )
-        {
-            Dependency d = i.next();
-
-            String scope = d.getScope();
-
-            if ( StringUtils.isEmpty( scope ) )
-            {
-                scope = Artifact.SCOPE_COMPILE;
-
-                d.setScope( scope );
-            }
-
-            VersionRange versionRange;
-            
-            //TODO: how does a poorly specified range turn into a VersionNotFoundException?
-            try
-            {
-                versionRange = VersionRange.createFromVersionSpec( d.getVersion() );
-            }
-            catch ( InvalidVersionSpecificationException e )
-            {
-                throw new VersionNotFoundException( reactor.getId(), d, reactor.getFile(), e );
-            }
-            
-            Artifact artifact = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(), versionRange, d.getType(), d.getClassifier(), scope, inheritedScope, d.isOptional() );
-
-            if ( Artifact.SCOPE_SYSTEM.equals( scope ) )
-            {
-                artifact.setFile( new File( d.getSystemPath() ) );
-            }
-
-            ArtifactFilter artifactFilter = dependencyFilter;
-
-            if ( ( artifact != null ) && ( ( artifactFilter == null ) || artifactFilter.include( artifact ) ) )
-            {
-                if ( ( d.getExclusions() != null ) && !d.getExclusions().isEmpty() )
-                {
-                    List<String> exclusions = new ArrayList<String>();
-                    for ( Iterator<Exclusion> j = d.getExclusions().iterator(); j.hasNext(); )
-                    {
-                        Exclusion e = j.next();
-                        exclusions.add( e.getGroupId() + ":" + e.getArtifactId() );
-                    }
-
-                    ArtifactFilter newFilter = new ExcludesArtifactFilter( exclusions );
-
-                    if ( artifactFilter != null )
-                    {
-                        AndArtifactFilter filter = new AndArtifactFilter();
-                        filter.add( artifactFilter );
-                        filter.add( newFilter );
-                        artifactFilter = filter;
-                    }
-                    else
-                    {
-                        artifactFilter = newFilter;
-                    }
-                }
-
-                artifact.setDependencyFilter( artifactFilter );
-
-                if ( reactor != null )
-                {
-                    artifact = reactor.find( artifact );
-                }
-
-                projectArtifacts.add( artifact );
-            }
-        }
-
-        return projectArtifacts;
-    }
-
     public ArtifactRepository buildArtifactRepository( Repository repo )
         throws InvalidRepositoryException
     {
         if ( repo != null )
         {
             String id = repo.getId();
+            
             String url = repo.getUrl();
-            /*
-            MNG-4050: Temporarily disabled this check since it is breaking the bootstrap unit tests on commons-parent pom
-             */
-            /*
-            if ( id == null || id.trim().length() < 1 )
-            {
-                throw new InvalidRepositoryException( "Repository ID must not be empty (URL is: " + url + ").", url );
-            }
-
-            if ( url == null || url.trim().length() < 1 )
-            {
-                throw new InvalidRepositoryException( "Repository URL must not be empty (ID is: " + id + ").", id );
-            }
-            */
+            
             ArtifactRepositoryPolicy snapshots = buildArtifactRepositoryPolicy( repo.getSnapshots() );
 
             ArtifactRepositoryPolicy releases = buildArtifactRepositoryPolicy( repo.getReleases() );
@@ -471,6 +372,18 @@
 
     public MetadataResolutionResult resolveMetadata( MetadataResolutionRequest request )
     {
+
+//      ArtifactResolutionResult collect( Set<Artifact> artifacts,
+//      Artifact originatingArtifact,
+//      Map managedVersions,
+//      ArtifactRepository localRepository,
+//      List<ArtifactRepository> remoteRepositories,
+//      ArtifactMetadataSource source,
+//      ArtifactFilter filter,
+//      List<ResolutionListener> listeners,
+//      List<ConflictResolver> conflictResolvers )
+        
+//        ArtifactResolutionResult result = artifactCollector.
         return null;
     }
 }

Modified: maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java (original)
+++ maven/components/branches/MNG-2766/maven-repository/src/main/java/org/apache/maven/repository/RepositorySystem.java Fri May  8 03:24:55 2009
@@ -25,7 +25,6 @@
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Plugin;
 import org.apache.maven.model.Repository;
@@ -57,14 +56,9 @@
     
     Artifact createDependencyArtifact( Dependency dependency );
     
-    //REMOVE
-    // This will disappear when we actually deal with resolving a root dependency and its dependencies. This is used everywhere because of that
-    // deficiency
-    Set<Artifact> createArtifacts( List<Dependency> dependencies, String inheritedScope, ArtifactFilter dependencyFilter, MavenRepositoryWrapper reactor )
-        throws VersionNotFoundException;
-
-    // Repository creation
-
+    //TODO: this needs a project to do anything useful
+    //Set<Artifact> createArtifacts();
+    
     // maven model
     ArtifactRepository buildArtifactRepository( Repository repository )
         throws InvalidRepositoryException;
@@ -97,13 +91,7 @@
      * @return
      */
     MetadataResolutionResult resolveMetadata( MetadataResolutionRequest request );
-       
-    //REMOVE
-    // Network enablement: this needs to go as we will know at a higher level from the embedder if the system is offline or not, we should not have to
-    // deal with this here.
-    void setOnline( boolean online );
-    boolean isOnline();
-    
+           
     //REMOVE
     // These should be associated with repositories and the repositories should be examine as part of metadatda and
     // artifact resolution. So these methods should also not be here.

Modified: maven/components/branches/MNG-2766/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-2766/pom.xml?rev=772832&r1=772831&r2=772832&view=diff
==============================================================================
--- maven/components/branches/MNG-2766/pom.xml (original)
+++ maven/components/branches/MNG-2766/pom.xml Fri May  8 03:24:55 2009
@@ -22,13 +22,16 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
+  <!--
   <parent>
     <groupId>org.apache.maven</groupId>
     <artifactId>maven-parent</artifactId>
     <version>11</version>
     <relativePath>../pom/maven/pom.xml</relativePath>
   </parent>
+  -->
 
+  <groupId>org.apache.maven</groupId>
   <artifactId>maven</artifactId>
   <version>3.0-SNAPSHOT</version>
   <packaging>pom</packaging>
@@ -294,16 +297,6 @@
         <artifactId>wagon-http-lightweight</artifactId>
         <version>${wagonVersion}</version>
       </dependency>
-      <dependency>
-        <groupId>org.apache.maven.wagon</groupId>
-        <artifactId>wagon-ssh</artifactId>
-        <version>${wagonVersion}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.maven.wagon</groupId>
-        <artifactId>wagon-ssh-external</artifactId>
-        <version>${wagonVersion}</version>
-      </dependency>
       <!--  Doxia -->
       <dependency>
         <groupId>org.apache.maven.doxia</groupId>