You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jo...@apache.org on 2007/02/03 05:28:22 UTC

svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Author: joakime
Date: Fri Feb  2 20:28:21 2007
New Revision: 503171

URL: http://svn.apache.org/viewvc?view=rev&rev=503171
Log:
Updated maven-project to utilize plexus-cache w/hashmap provider.
Seems to pass all integration tests ok.
Review?


Added:
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml   (with props)
Modified:
    maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
    maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/BuildExtensionScanner.java
    maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java
    maven/components/branches/maven-trunk-caching-update/maven-core/src/main/resources/META-INF/plexus/components.xml
    maven/components/branches/maven-trunk-caching-update/maven-project/pom.xml
    maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
    maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
    maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/ModelLineageBuilder.java
    maven/components/branches/maven-trunk-caching-update/maven-project/src/main/resources/META-INF/plexus/components.xml
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/java/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.java
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
    maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml

Modified: maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/DefaultMaven.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/DefaultMaven.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/DefaultMaven.java Fri Feb  2 20:28:21 2007
@@ -50,6 +50,7 @@
 import org.apache.maven.usability.diagnostics.ErrorDiagnostics;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.cache.Cache;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -64,10 +65,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.TimeZone;
 
 /**
@@ -96,6 +95,8 @@
     protected RuntimeInformation runtimeInformation;
 
     private BuildExtensionScanner buildExtensionScanner;
+    
+    private Cache pomFileCache;
 
     private static final long MB = 1024 * 1024;
 
@@ -345,17 +346,13 @@
             throw new MavenExecutionException( "Error selecting project files for the reactor: " + e.getMessage(), e );
         }
         
-        // TODO: We should probably do this discovery just-in-time, if we can move to building project
-        // instances just-in-time.
-        Map cache = new HashMap();
-        
         for ( Iterator it = files.iterator(); it.hasNext(); )
         {
             File pom = (File) it.next();
 
             try
             {
-                buildExtensionScanner.scanForBuildExtensions( pom, request.getLocalRepository(), globalProfileManager, cache );
+                buildExtensionScanner.scanForBuildExtensions( pom, request.getLocalRepository(), globalProfileManager, pomFileCache );
             }
             catch ( ExtensionScanningException e )
             {

Modified: maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/BuildExtensionScanner.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/BuildExtensionScanner.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/BuildExtensionScanner.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/BuildExtensionScanner.java Fri Feb  2 20:28:21 2007
@@ -2,16 +2,16 @@
 
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.profiles.ProfileManager;
+import org.codehaus.plexus.cache.Cache;
 
 import java.io.File;
-import java.util.Map;
 
 public interface BuildExtensionScanner
 {
     
     String ROLE = BuildExtensionScanner.class.getName();
     
-    void scanForBuildExtensions( File pom, ArtifactRepository localRepository, ProfileManager globalProfileManager, Map pomFilesById )
+    void scanForBuildExtensions( File pom, ArtifactRepository localRepository, ProfileManager globalProfileManager, Cache pomFilesById )
         throws ExtensionScanningException;
 
 }

Modified: maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-core/src/main/java/org/apache/maven/extension/DefaultBuildExtensionScanner.java Fri Feb  2 20:28:21 2007
@@ -19,12 +19,12 @@
 import org.apache.maven.project.interpolation.ModelInterpolationException;
 import org.apache.maven.project.interpolation.ModelInterpolator;
 import org.codehaus.plexus.PlexusContainerException;
+import org.codehaus.plexus.cache.Cache;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
 
 import java.io.File;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -48,7 +48,7 @@
     private ModelInterpolator modelInterpolator;
 
     public void scanForBuildExtensions( File pom, ArtifactRepository localRepository,
-                                        ProfileManager globalProfileManager, Map pomFilesById )
+                                        ProfileManager globalProfileManager, Cache pomFilesById )
         throws ExtensionScanningException
     {
         // setup the CustomActivatorAdvice to fail quietly while we discover extensions...then, we'll
@@ -110,7 +110,7 @@
 
     private void checkModulesForExtensions( File containingPom, Model model, ArtifactRepository localRepository,
                                             List originalRemoteRepositories, ProfileManager globalProfileManager,
-                                            Map pomFilesById )
+                                            Cache pomFilesById )
         throws ExtensionScanningException
     {
         // FIXME: This gets a little sticky, because modules can be added by profiles that require
@@ -199,7 +199,7 @@
 
     private ModelLineage buildModelLineage( File pom, ArtifactRepository localRepository,
                                             List originalRemoteRepositories, ProfileManager globalProfileManager,
-                                            Map cache )
+                                            Cache cache )
         throws ExtensionScanningException
     {
         ModelLineage lineage;

Modified: maven/components/branches/maven-trunk-caching-update/maven-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-core/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-core/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-core/src/main/resources/META-INF/plexus/components.xml Fri Feb  2 20:28:21 2007
@@ -128,6 +128,11 @@
         <requirement>
           <role>org.apache.maven.execution.RuntimeInformation</role>
         </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>cache-PomFilesById</role-hint>
+          <field-name>pomFileCache</field-name>
+        </requirement>
       </requirements>
     </component>
 

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/pom.xml?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/pom.xml (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/pom.xml Fri Feb  2 20:28:21 2007
@@ -78,6 +78,11 @@
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-container-default</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus.cache</groupId>
+      <artifactId>plexus-cache-hashmap</artifactId>
+      <version>1.0-alpha-1-SNAPSHOT</version>
+    </dependency>
       <dependency>
         <groupId>org.apache.maven.wagon</groupId>
         <artifactId>wagon-file</artifactId>

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/DefaultMavenProjectBuilder.java Fri Feb  2 20:28:21 2007
@@ -63,6 +63,7 @@
 import org.apache.maven.wagon.events.TransferListener;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.cache.Cache;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
@@ -150,9 +151,9 @@
 
     private ModelValidator validator;
     
-    private Map processedProjectCache = new HashMap();
+    private Cache processedProjectCache;
     
-    private Map cachedPomFilesByModelId = new HashMap();
+    private Cache cachedPomFilesByModelId;
 
     // TODO: make it a component
     private MavenXpp3Reader modelReader;

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/DefaultModelLineageBuilder.java Fri Feb  2 20:28:21 2007
@@ -14,6 +14,7 @@
 import org.apache.maven.profiles.ProfileManager;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.build.profile.ProfileAdvisor;
+import org.codehaus.plexus.cache.Cache;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.logging.console.ConsoleLogger;
@@ -28,7 +29,6 @@
 import java.util.Collections;
 import java.util.LinkedHashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
 /**
@@ -64,7 +64,7 @@
      * @see org.apache.maven.project.build.model.ModelLineageBuilder#buildModelLineage(java.io.File, org.apache.maven.artifact.repository.ArtifactRepository, java.util.List)
      */
     public ModelLineage buildModelLineage( File pom, ArtifactRepository localRepository, List remoteRepositories,
-                                           ProfileManager profileManager, Map cachedPomFilesByModelId )
+                                           ProfileManager profileManager, Cache cachedPomFilesByModelId )
         throws ProjectBuildingException
     {
         ModelLineage lineage = new DefaultModelLineage();
@@ -96,7 +96,7 @@
     }
 
     public void resumeBuildingModelLineage( ModelLineage lineage, ArtifactRepository localRepository,
-                                            ProfileManager profileManager, Map cachedPomFilesByModelId )
+                                            ProfileManager profileManager, Cache cachedPomFilesByModelId )
         throws ProjectBuildingException
     {
         File pomFile = lineage.getDeepestFile();
@@ -146,7 +146,7 @@
      * Read the Model instance from the given POM file, and cache it in the given Map before 
      * returning it.
      */
-    private Model readModel( File pomFile, Map cachedPomFilesByModelId )
+    private Model readModel( File pomFile, Cache cachedPomFilesByModelId )
         throws ProjectBuildingException
     {
         return readModel( pomFile, cachedPomFilesByModelId, false );
@@ -157,7 +157,7 @@
      * Model instance in the given Map before returning it. The skipCache flag controls whether the
      * Model instance is actually cached.
      */
-    private Model readModel( File pom, Map cachedPomFilesByModelId, boolean skipCache )
+    private Model readModel( File pom, Cache cachedPomFilesByModelId, boolean skipCache )
         throws ProjectBuildingException
     {
         File pomFile = pom;
@@ -268,7 +268,7 @@
      * @param cachedModelsById 
      */
     private File resolveParentPom( Model model, List remoteRepositories, ArtifactRepository localRepository,
-                                   File modelPomFile, Map cachedModelsById )
+                                   File modelPomFile, Cache cachedModelsById )
         throws ProjectBuildingException
     {
         Parent modelParent = model.getParent();

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/ModelLineageBuilder.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/ModelLineageBuilder.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/ModelLineageBuilder.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/main/java/org/apache/maven/project/build/model/ModelLineageBuilder.java Fri Feb  2 20:28:21 2007
@@ -3,10 +3,10 @@
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.profiles.ProfileManager;
 import org.apache.maven.project.ProjectBuildingException;
+import org.codehaus.plexus.cache.Cache;
 
 import java.io.File;
 import java.util.List;
-import java.util.Map;
 
 /**
  * Builds the lineage of Model instances, starting from a given POM file, and stretching back through
@@ -37,7 +37,7 @@
      *   have an incorrect relativePath
      */
     ModelLineage buildModelLineage( File pom, ArtifactRepository localRepository, List remoteRepositories,
-                                    ProfileManager profileManager, Map cachedPomFilesByModelId )
+                                    ProfileManager profileManager, Cache cachedPomFilesByModelId )
         throws ProjectBuildingException;
 
     /**
@@ -53,7 +53,7 @@
      *   have an incorrect relativePath
      */
     void resumeBuildingModelLineage( ModelLineage lineage, ArtifactRepository localRepository,
-                                     ProfileManager profileManager, Map cachedPomFilesByModelId )
+                                     ProfileManager profileManager, Cache cachedPomFilesByModelId )
         throws ProjectBuildingException;
 
 }

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/main/resources/META-INF/plexus/components.xml (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/main/resources/META-INF/plexus/components.xml Fri Feb  2 20:28:21 2007
@@ -87,6 +87,26 @@
      |
      -->
     <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>projectBuilder-processed</role-hint>
+      <implementation>org.codehaus.plexus.cache.hashmap.HashMapCache</implementation>
+      <configuration>
+        <cache-hit-ratio>1.0</cache-hit-ratio>
+        <cache-max-size>0</cache-max-size>
+      </configuration>
+    </component>     
+     
+    <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>cache-PomFilesById</role-hint>
+      <implementation>org.codehaus.plexus.cache.hashmap.HashMapCache</implementation>
+      <configuration>
+        <cache-hit-ratio>1.0</cache-hit-ratio>
+        <cache-max-size>0</cache-max-size>
+      </configuration>
+    </component>     
+    
+    <component>
       <role>org.apache.maven.project.MavenProjectBuilder</role>
       <implementation>org.apache.maven.project.DefaultMavenProjectBuilder</implementation>
       <requirements>
@@ -131,6 +151,16 @@
         </requirement>
         <requirement>
           <role>org.apache.maven.MavenTools</role>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>projectBuilder-processed</role-hint>
+          <field-name>processedProjectCache</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>cache-PomFilesById</role-hint>
+          <field-name>cachedPomFilesByModelId</field-name>
         </requirement>
       </requirements>
     </component>

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/java/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/test/java/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.java?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/test/java/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.java (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/test/java/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.java Fri Feb  2 20:28:21 2007
@@ -8,6 +8,7 @@
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
 import org.apache.maven.project.ProjectBuildingException;
 import org.codehaus.plexus.PlexusTestCase;
+import org.codehaus.plexus.cache.Cache;
 import org.codehaus.plexus.logging.Logger;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.IOUtil;
@@ -16,9 +17,7 @@
 import java.io.FileWriter;
 import java.io.IOException;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Map;
 
 public class DefaultModelLineageBuilderTest
     extends PlexusTestCase
@@ -27,12 +26,16 @@
     private DefaultModelLineageBuilder modelLineageBuilder;
 
     private ArtifactRepositoryLayout defaultLayout;
+    
+    private Cache testCache;
 
     public void setUp()
         throws Exception
     {
         super.setUp();
         getContainer().getLoggerManager().setThresholds( Logger.LEVEL_DEBUG );
+        
+        testCache = (Cache) lookup( Cache.ROLE, "testCache" );
 
         modelLineageBuilder = (DefaultModelLineageBuilder) lookup( ModelLineageBuilder.ROLE,
                                                                    DefaultModelLineageBuilder.ROLE_HINT );
@@ -40,6 +43,13 @@
         defaultLayout = (ArtifactRepositoryLayout) lookup( ArtifactRepositoryLayout.ROLE, "default" );
     }
 
+    protected void tearDown()
+        throws Exception
+    {
+        release( testCache );
+        super.tearDown();
+    }
+
     public void testShouldReadSinglePomWithNoParents()
         throws IOException, ProjectBuildingException
     {
@@ -68,7 +78,7 @@
             IOUtil.close( writer );
         }
 
-        ModelLineage lineage = modelLineageBuilder.buildModelLineage( pomFile, null, null, null, new HashMap() );
+        ModelLineage lineage = modelLineageBuilder.buildModelLineage( pomFile, null, null, null, testCache );
 
         assertEquals( 1, lineage.size() );
 
@@ -126,7 +136,7 @@
             .toExternalForm(), defaultLayout );
 
         ModelLineage lineage = modelLineageBuilder.buildModelLineage( currentPOM, localRepository,
-                                                                      Collections.EMPTY_LIST, null, new HashMap() );
+                                                                      Collections.EMPTY_LIST, null, testCache );
 
         assertEquals( 3, lineage.size() );
 
@@ -198,7 +208,7 @@
             .toExternalForm(), defaultLayout );
 
         ModelLineage lineage = modelLineageBuilder.buildModelLineage( currentPOM, localRepository, Collections
-            .singletonList( remoteRepository ), null, new HashMap() );
+            .singletonList( remoteRepository ), null, testCache );
 
         assertEquals( 3, lineage.size() );
 
@@ -253,7 +263,7 @@
             .toExternalForm(), defaultLayout );
 
         ModelLineage lineage = modelLineageBuilder.buildModelLineage( currentPOM, localRepository,
-                                                                      Collections.EMPTY_LIST, null, new HashMap() );
+                                                                      Collections.EMPTY_LIST, null, testCache );
 
         assertEquals( 2, lineage.size() );
 
@@ -314,8 +324,7 @@
         // 4. write the parent model to the local repo directory
         writeModel( parent, parentPOM );
         
-        Map cache = new HashMap();
-        cache.put( "group:parent:1", parentPOM );
+        testCache.put( "group:parent:1", parentPOM );
 
         // 5. create the current pom with a parent-ref on the parent model
         Model current = createModel( "group", "current", "1" );
@@ -336,13 +345,12 @@
 
         // 7. build the lineage.
         ModelLineage lineage = modelLineageBuilder.buildModelLineage( currentPOM, null, Collections
-            .EMPTY_LIST, null, cache );
+            .EMPTY_LIST, null, testCache );
 
         assertEquals( 2, lineage.size() );
 
         Iterator modelIterator = lineage.modelIterator();
 
-        assertEquals( 2, cache.size() );
         assertEquals( current.getId(), ( (Model) modelIterator.next() ).getId() );
         assertEquals( parent.getId(), ( (Model) modelIterator.next() ).getId() );
     }

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/ProjectClasspathTest.xml Fri Feb  2 20:28:21 2007
@@ -98,6 +98,16 @@
         <requirement>
           <role>org.apache.maven.MavenTools</role>
         </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>projectBuilder-processed</role-hint>
+          <field-name>processedProjectCache</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>cache-PomFilesById</role-hint>
+          <field-name>cachedPomFilesByModelId</field-name>
+        </requirement>
       </requirements>
     </component>
   </components>

Added: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml?view=auto&rev=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml (added)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml Fri Feb  2 20:28:21 2007
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<plexus>
+  <components>
+  
+    <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>testCache</role-hint>
+      <implementation>org.codehaus.plexus.cache.hashmap.HashMapCache</implementation>
+      <configuration>
+        <cache-hit-ratio>1.0</cache-hit-ratio>
+        <cache-max-size>0</cache-max-size>
+      </configuration>
+    </component>     
+     
+  </components>
+</plexus>
\ No newline at end of file

Propchange: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/build/model/DefaultModelLineageBuilderTest.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml?view=diff&rev=503171&r1=503170&r2=503171
==============================================================================
--- maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml (original)
+++ maven/components/branches/maven-trunk-caching-update/maven-project/src/test/resources/org/apache/maven/project/canonical/CanonicalProjectBuilderTest.xml Fri Feb  2 20:28:21 2007
@@ -98,6 +98,16 @@
           <role>org.apache.maven.context.BuildContextManager</role>
           <role-hint>default</role-hint>
         </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>projectBuilder-processed</role-hint>
+          <field-name>processedProjectCache</field-name>
+        </requirement>
+        <requirement>
+          <role>org.codehaus.plexus.cache.Cache</role>
+          <role-hint>cache-PomFilesById</role-hint>
+          <field-name>cachedPomFilesByModelId</field-name>
+        </requirement>
       </requirements>
     </component>
   </components>



Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Brett Porter <br...@apache.org>.
On 05/02/2007, at 1:17 PM, Jason van Zyl wrote:

>> That doesn't answer my question. No cache in Maven at all, or  
>> somewhere else? (Neither option being in the project builder).
>
> A cache in the reactor manager, or somewhere else that would  
> provide control at the session level. Even in the embedder I  
> probably wouldn't want to get into the mess right away of having to  
> check on disk for changes yet. Just toss them all at the end of the  
> session, start fresh. A global cache of release POMs would be fine  
> as in theory those are immutable and safe to store. But we're not  
> making any distinction there.

Ok, this all makes sense to me.

- Brett

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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Jason van Zyl <ja...@maven.org>.
On 4 Feb 07, at 5:31 PM 4 Feb 07, Brett Porter wrote:

>
> On 05/02/2007, at 12:15 PM, Jason van Zyl wrote:
>
>>> It's bleeding memory because there are thousands of POMs in the  
>>> repository, and the hashmap has no limiting. A cache would allow  
>>> them to be expired, size, limited, etc. so the memory consumption  
>>> is fixed.
>>>
>>
>> That's just not the function of the builder. That's just wrong as  
>> it's just not the job of the builder to be storing them like that.
>
> I've already agreed with that multiple times. I'm trying to explain  
> why it's a problem now.
>
>>>
>>> Not really understanding here. Are you saying no cache is  
>>> necessary, or it can be done elsewhere?
>>
>> In the builder no cache should be present. It was jacked in there  
>> to make reactor builds work a little quicker.
>
> That doesn't answer my question. No cache in Maven at all, or  
> somewhere else? (Neither option being in the project builder).

A cache in the reactor manager, or somewhere else that would provide  
control at the session level. Even in the embedder I probably  
wouldn't want to get into the mess right away of having to check on  
disk for changes yet. Just toss them all at the end of the session,  
start fresh. A global cache of release POMs would be fine as in  
theory those are immutable and safe to store. But we're not making  
any distinction there.

>
>>
>>> Dependency POMs are built many times across the life of a maven  
>>> build, so the cache is certainly improving performance compared  
>>> to reading them back from the file system in the local repository.
>>
>> I don't think anyone has ever measured how long it actually takes  
>> to build a MavenProject. I don't think we want to put all that  
>> logic in there anyway, because if you start using for things like  
>> Archiva then you start having to check timestamps on disk or other  
>> source changes. I think the caching should just be removed from  
>> the builder.
>
> I'm not talking about Archiva here, and I'm not talking about  
> keeping a cache in the project builder.
>
> We can measure it to find out later, but I'm almost certain some  
> level of caching will be needed somewhere (probably the resolver,  
> or a new component) because of the amount of times the POMs are  
> read in Maven itself. It may not be a flat POM cache, it might be a  
> different way the resolver uses and stores the data it gets back.
>
> Anyway, as the builder is used today, I am sure that just removing  
> the caching will degrade performance as it will read back from the  
> disk a number of times. Artifact and project builder changes may  
> change that, but I'm trying to take this one step at a time.
>
>>>
>>>> In something like Archiva the model should be placed in a store,  
>>>> not cached so I don't think it really helps there a whole lot.
>>>
>>> That's a separate discussion, but the repository is the store.
>>
>> That's one store. I'm actually sticking them in an object database  
>> and who knows what other third party tool folks will do.
>
> That's fine, but it is a store that needs to read POMs.
>
>>
>>> Only a subset of the POM is stored in the index, and there is no  
>>> point duplicating the POM it into some other store.
>>
>> If you have read a released POM and have stored to a database why  
>> would you ever need to build it again? Barring silly people re- 
>> releasing the same things for a release consisting of all releases  
>> that closure could be stored and really not need to ever be read  
>> from a pom.xml file again.
>
> I doubt duplicating the data in a database will make it any faster  
> than using the project builder. And in both cases, a cache will be  
> needed. But anyway, not relevant.
>
>> So if we put that in there and then two weeks from now I pull it  
>> out and remove the caching you guys aren't going to complain?
>
> No, because there's no way I'd use 2.1-SNAPSHOT in Archiva. Once it  
> gets released, we can migrate to any new APIs, but I'm pretty sick  
> of chasing moving API targets.

There have been no API changes in Maven's trunk.

>
>> If Joakim wanted to take a stab at that I would work with him for  
>> a day to try and fix the builder properly. I'm sure in a day  
>> between the two of us we could chop the project builder apart and  
>> fix it properly. The cache in there is a band aid.
>
> That's up to entirely up to him, but I certainly won't advocate  
> using trunk in Archiva yet.
>
> - Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Brett Porter <br...@apache.org>.
On 05/02/2007, at 12:15 PM, Jason van Zyl wrote:

>> It's bleeding memory because there are thousands of POMs in the  
>> repository, and the hashmap has no limiting. A cache would allow  
>> them to be expired, size, limited, etc. so the memory consumption  
>> is fixed.
>>
>
> That's just not the function of the builder. That's just wrong as  
> it's just not the job of the builder to be storing them like that.

I've already agreed with that multiple times. I'm trying to explain  
why it's a problem now.

>>
>> Not really understanding here. Are you saying no cache is  
>> necessary, or it can be done elsewhere?
>
> In the builder no cache should be present. It was jacked in there  
> to make reactor builds work a little quicker.

That doesn't answer my question. No cache in Maven at all, or  
somewhere else? (Neither option being in the project builder).

>
>> Dependency POMs are built many times across the life of a maven  
>> build, so the cache is certainly improving performance compared to  
>> reading them back from the file system in the local repository.
>
> I don't think anyone has ever measured how long it actually takes  
> to build a MavenProject. I don't think we want to put all that  
> logic in there anyway, because if you start using for things like  
> Archiva then you start having to check timestamps on disk or other  
> source changes. I think the caching should just be removed from the  
> builder.

I'm not talking about Archiva here, and I'm not talking about keeping  
a cache in the project builder.

We can measure it to find out later, but I'm almost certain some  
level of caching will be needed somewhere (probably the resolver, or  
a new component) because of the amount of times the POMs are read in  
Maven itself. It may not be a flat POM cache, it might be a different  
way the resolver uses and stores the data it gets back.

Anyway, as the builder is used today, I am sure that just removing  
the caching will degrade performance as it will read back from the  
disk a number of times. Artifact and project builder changes may  
change that, but I'm trying to take this one step at a time.

>>
>>> In something like Archiva the model should be placed in a store,  
>>> not cached so I don't think it really helps there a whole lot.
>>
>> That's a separate discussion, but the repository is the store.
>
> That's one store. I'm actually sticking them in an object database  
> and who knows what other third party tool folks will do.

That's fine, but it is a store that needs to read POMs.

>
>> Only a subset of the POM is stored in the index, and there is no  
>> point duplicating the POM it into some other store.
>
> If you have read a released POM and have stored to a database why  
> would you ever need to build it again? Barring silly people re- 
> releasing the same things for a release consisting of all releases  
> that closure could be stored and really not need to ever be read  
> from a pom.xml file again.

I doubt duplicating the data in a database will make it any faster  
than using the project builder. And in both cases, a cache will be  
needed. But anyway, not relevant.

> So if we put that in there and then two weeks from now I pull it  
> out and remove the caching you guys aren't going to complain?

No, because there's no way I'd use 2.1-SNAPSHOT in Archiva. Once it  
gets released, we can migrate to any new APIs, but I'm pretty sick of  
chasing moving API targets.

> If Joakim wanted to take a stab at that I would work with him for a  
> day to try and fix the builder properly. I'm sure in a day between  
> the two of us we could chop the project builder apart and fix it  
> properly. The cache in there is a band aid.

That's up to entirely up to him, but I certainly won't advocate using  
trunk in Archiva yet.

- Brett

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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Jason van Zyl <ja...@maven.org>.
On 4 Feb 07, at 4:12 PM 4 Feb 07, Brett Porter wrote:

>
> On 05/02/2007, at 11:01 AM, Jason van Zyl wrote:
>
>> I think there is something wrong in that we would need a cache.  
>> It's bleeding memory why and how is a cache implementation over a  
>> HashMap going to help?
>
> It's bleeding memory because there are thousands of POMs in the  
> repository, and the hashmap has no limiting. A cache would allow  
> them to be expired, size, limited, etc. so the memory consumption  
> is fixed.
>

That's just not the function of the builder. That's just wrong as  
it's just not the job of the builder to be storing them like that.

>>
>> And how long does it really take to build up a MavenProject. In  
>> the CLI working in the reactor it helps using a HashMap.
>
> Not really understanding here. Are you saying no cache is  
> necessary, or it can be done elsewhere?

In the builder no cache should be present. It was jacked in there to  
make reactor builds work a little quicker.

> Dependency POMs are built many times across the life of a maven  
> build, so the cache is certainly improving performance compared to  
> reading them back from the file system in the local repository.

I don't think anyone has ever measured how long it actually takes to  
build a MavenProject. I don't think we want to put all that logic in  
there anyway, because if you start using for things like Archiva then  
you start having to check timestamps on disk or other source changes.  
I think the caching should just be removed from the builder.
>
>> In something like Archiva the model should be placed in a store,  
>> not cached so I don't think it really helps there a whole lot.
>
> That's a separate discussion, but the repository is the store.

That's one store. I'm actually sticking them in an object database  
and who knows what other third party tool folks will do.

> Only a subset of the POM is stored in the index, and there is no  
> point duplicating the POM it into some other store.

If you have read a released POM and have stored to a database why  
would you ever need to build it again? Barring silly people re- 
releasing the same things for a release consisting of all releases  
that closure could be stored and really not need to ever be read from  
a pom.xml file again.

>
> Anyway, not relevant - the current project builder caches  
> everything and needs to be made configurable so that it doesn't.

I think the builder needs not to cache and then we make sure  
everything works properly and when that's fine then start optimizing.  
If you need this for the branch then that's fine but I would prefer  
the trunk get cleaned up properly. The caching in the builder is  
causing some very strange side effects.

>
>>
>>> I don't see why it would matter, it's just swapping  
>>> implementations - either way the cache still needs to be moved if  
>>> the project builder is cleaned up. IMO it would be better not to  
>>> lose track of the change and do it now.
>>
>> The function of the cache in there was ever only the short-lived  
>> in-session reactor so that it didn't rebuild in that case.  A long- 
>> lived app should not be pulling an object from a cache from the  
>> building to show in an application. A cache helping a real store  
>> maybe, but in short that HashMap in the builder was for very short- 
>> lived reasons i.e. the reactor and the builder is probably then  
>> the wrong place for the cache. The builder should not be in the  
>> business of caching project objects for applications.
>
> I agree, but that wasn't my point.
>
> How about if instead the project builder adds a temporary config  
> item that allows disabling the hashmap cache instead. Keep it there  
> until it is refactored out so Maven keeps working, and we can  
> disable it from Archiva and take care of the caching there?

If you want to do on the branch go for it, but again I think the  
caching should be tossed out of the builder and make to work  
properly. I mean why not take the effort in the builder, toss the  
cache, make it work and then use that cleaned up version in archiva?  
That would probably serve your purposes for a long-lived process more  
anyway no?

So if we put that in there and then two weeks from now I pull it out  
and remove the caching you guys aren't going to complain?

If Joakim wanted to take a stab at that I would work with him for a  
day to try and fix the builder properly. I'm sure in a day between  
the two of us we could chop the project builder apart and fix it  
properly. The cache in there is a band aid.

Jason.

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


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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Joakim Erdfelt <jo...@erdfelt.com>.
I'd like to see more people test this branch against their own code.
Test it on their own system, use the integration tests.
I'm a bit surprised there was so little problems with it on my end.

- Joakim

Brett Porter wrote:
>
> On 05/02/2007, at 11:01 AM, Jason van Zyl wrote:
>
>> I think there is something wrong in that we would need a cache. It's 
>> bleeding memory why and how is a cache implementation over a HashMap 
>> going to help?
>
> It's bleeding memory because there are thousands of POMs in the 
> repository, and the hashmap has no limiting. A cache would allow them 
> to be expired, size, limited, etc. so the memory consumption is fixed.
>
>>
>> And how long does it really take to build up a MavenProject. In the 
>> CLI working in the reactor it helps using a HashMap.
>
> Not really understanding here. Are you saying no cache is necessary, 
> or it can be done elsewhere? Dependency POMs are built many times 
> across the life of a maven build, so the cache is certainly improving 
> performance compared to reading them back from the file system in the 
> local repository.
>
>> In something like Archiva the model should be placed in a store, not 
>> cached so I don't think it really helps there a whole lot.
>
> That's a separate discussion, but the repository is the store. Only a 
> subset of the POM is stored in the index, and there is no point 
> duplicating the POM it into some other store.
>
> Anyway, not relevant - the current project builder caches everything 
> and needs to be made configurable so that it doesn't.
>
>>
>>> I don't see why it would matter, it's just swapping implementations 
>>> - either way the cache still needs to be moved if the project 
>>> builder is cleaned up. IMO it would be better not to lose track of 
>>> the change and do it now.
>>
>> The function of the cache in there was ever only the short-lived 
>> in-session reactor so that it didn't rebuild in that case.  A 
>> long-lived app should not be pulling an object from a cache from the 
>> building to show in an application. A cache helping a real store 
>> maybe, but in short that HashMap in the builder was for very 
>> short-lived reasons i.e. the reactor and the builder is probably then 
>> the wrong place for the cache. The builder should not be in the 
>> business of caching project objects for applications.
>
> I agree, but that wasn't my point.
>
> How about if instead the project builder adds a temporary config item 
> that allows disabling the hashmap cache instead. Keep it there until 
> it is refactored out so Maven keeps working, and we can disable it 
> from Archiva and take care of the caching there?
>
> - Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>


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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Brett Porter <br...@apache.org>.
On 05/02/2007, at 11:01 AM, Jason van Zyl wrote:

> I think there is something wrong in that we would need a cache.  
> It's bleeding memory why and how is a cache implementation over a  
> HashMap going to help?

It's bleeding memory because there are thousands of POMs in the  
repository, and the hashmap has no limiting. A cache would allow them  
to be expired, size, limited, etc. so the memory consumption is fixed.

>
> And how long does it really take to build up a MavenProject. In the  
> CLI working in the reactor it helps using a HashMap.

Not really understanding here. Are you saying no cache is necessary,  
or it can be done elsewhere? Dependency POMs are built many times  
across the life of a maven build, so the cache is certainly improving  
performance compared to reading them back from the file system in the  
local repository.

> In something like Archiva the model should be placed in a store,  
> not cached so I don't think it really helps there a whole lot.

That's a separate discussion, but the repository is the store. Only a  
subset of the POM is stored in the index, and there is no point  
duplicating the POM it into some other store.

Anyway, not relevant - the current project builder caches everything  
and needs to be made configurable so that it doesn't.

>
>> I don't see why it would matter, it's just swapping  
>> implementations - either way the cache still needs to be moved if  
>> the project builder is cleaned up. IMO it would be better not to  
>> lose track of the change and do it now.
>
> The function of the cache in there was ever only the short-lived in- 
> session reactor so that it didn't rebuild in that case.  A long- 
> lived app should not be pulling an object from a cache from the  
> building to show in an application. A cache helping a real store  
> maybe, but in short that HashMap in the builder was for very short- 
> lived reasons i.e. the reactor and the builder is probably then the  
> wrong place for the cache. The builder should not be in the  
> business of caching project objects for applications.

I agree, but that wasn't my point.

How about if instead the project builder adds a temporary config item  
that allows disabling the hashmap cache instead. Keep it there until  
it is refactored out so Maven keeps working, and we can disable it  
from Archiva and take care of the caching there?

- Brett

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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Jason van Zyl <ja...@maven.org>.
On 4 Feb 07, at 3:30 PM 4 Feb 07, Brett Porter wrote:

> I said the branch. I'd like this in maven 2.0.x since it's simply  
> swapping an implementation, but it will allow Continuum and Archiva  
> to stop bleeding memory.
>
> I assumed it was going to need to be on trunk first to meet the  
> 'develop on trunk first' requirement, but if it's a hassle that's  
> not a big deal.

I think there is something wrong in that we would need a cache. It's  
bleeding memory why and how is a cache implementation over a HashMap  
going to help?

And how long does it really take to build up a MavenProject. In the  
CLI working in the reactor it helps using a HashMap. In something  
like Archiva the model should be placed in a store, not cached so I  
don't think it really helps there a whole lot.

> I don't see why it would matter, it's just swapping implementations  
> - either way the cache still needs to be moved if the project  
> builder is cleaned up. IMO it would be better not to lose track of  
> the change and do it now.

The function of the cache in there was ever only the short-lived in- 
session reactor so that it didn't rebuild in that case.  A long-lived  
app should not be pulling an object from a cache from the building to  
show in an application. A cache helping a real store maybe, but in  
short that HashMap in the builder was for very short-lived reasons  
i.e. the reactor and the builder is probably then the wrong place for  
the cache. The builder should not be in the business of caching  
project objects for applications.

Jason.

>
> - Brett
>
> On 05/02/2007, at 10:25 AM, Jason van Zyl wrote:
>
>> Please don't apply this to the trunk until the project builder is  
>> cleaned up.
>>
>> Jason.
>>
>> On 4 Feb 07, at 3:02 PM 4 Feb 07, Brett Porter wrote:
>>
>>>
>>> On 03/02/2007, at 3:28 PM, joakime@apache.org wrote:
>>>
>>>> Author: joakime
>>>> Date: Fri Feb  2 20:28:21 2007
>>>> New Revision: 503171
>>>>
>>>> URL: http://svn.apache.org/viewvc?view=rev&rev=503171
>>>> Log:
>>>> Updated maven-project to utilize plexus-cache w/hashmap provider.
>>>> Seems to pass all integration tests ok.
>>>> Review?
>>>>
>>>
>>> This looks fine to me. Can we apply it to the branch too?
>>>
>>> - Brett
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Brett Porter <br...@apache.org>.
I said the branch. I'd like this in maven 2.0.x since it's simply  
swapping an implementation, but it will allow Continuum and Archiva  
to stop bleeding memory.

I assumed it was going to need to be on trunk first to meet the  
'develop on trunk first' requirement, but if it's a hassle that's not  
a big deal. I don't see why it would matter, it's just swapping  
implementations - either way the cache still needs to be moved if the  
project builder is cleaned up. IMO it would be better not to lose  
track of the change and do it now.

- Brett

On 05/02/2007, at 10:25 AM, Jason van Zyl wrote:

> Please don't apply this to the trunk until the project builder is  
> cleaned up.
>
> Jason.
>
> On 4 Feb 07, at 3:02 PM 4 Feb 07, Brett Porter wrote:
>
>>
>> On 03/02/2007, at 3:28 PM, joakime@apache.org wrote:
>>
>>> Author: joakime
>>> Date: Fri Feb  2 20:28:21 2007
>>> New Revision: 503171
>>>
>>> URL: http://svn.apache.org/viewvc?view=rev&rev=503171
>>> Log:
>>> Updated maven-project to utilize plexus-cache w/hashmap provider.
>>> Seems to pass all integration tests ok.
>>> Review?
>>>
>>
>> This looks fine to me. Can we apply it to the branch too?
>>
>> - Brett
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org

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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Jason van Zyl <ja...@maven.org>.
Please don't apply this to the trunk until the project builder is  
cleaned up.

Jason.

On 4 Feb 07, at 3:02 PM 4 Feb 07, Brett Porter wrote:

>
> On 03/02/2007, at 3:28 PM, joakime@apache.org wrote:
>
>> Author: joakime
>> Date: Fri Feb  2 20:28:21 2007
>> New Revision: 503171
>>
>> URL: http://svn.apache.org/viewvc?view=rev&rev=503171
>> Log:
>> Updated maven-project to utilize plexus-cache w/hashmap provider.
>> Seems to pass all integration tests ok.
>> Review?
>>
>
> This looks fine to me. Can we apply it to the branch too?
>
> - Brett
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


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


Re: svn commit: r503171 - in /maven/components/branches/maven-trunk-caching-update: maven-core/src/main/java/org/apache/maven/ maven-core/src/main/java/org/apache/maven/extension/ maven-core/src/main/resources/META-INF/plexus/ maven-project/ maven-project/...

Posted by Brett Porter <br...@apache.org>.
On 03/02/2007, at 3:28 PM, joakime@apache.org wrote:

> Author: joakime
> Date: Fri Feb  2 20:28:21 2007
> New Revision: 503171
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=503171
> Log:
> Updated maven-project to utilize plexus-cache w/hashmap provider.
> Seems to pass all integration tests ok.
> Review?
>

This looks fine to me. Can we apply it to the branch too?

- Brett

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