maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r719487 - /maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
Date Fri, 21 Nov 2008 05:54:01 GMT
Author: sisbell
Date: Thu Nov 20 21:54:01 2008
New Revision: 719487

URL: http://svn.apache.org/viewvc?rev=719487&view=rev
Log:
Added in listeners to PomTransformers. Fixed a couple of rules.

Modified:
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java?rev=719487&r1=719486&r2=719487&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
(original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
Thu Nov 20 21:54:01 2008
@@ -99,6 +99,8 @@
 
                                                                           ProjectUri.Repositories.xUri)
));
 
+    private static Map<String, List<ModelProperty>> cache = new HashMap<String,
List<ModelProperty>>();
+
     /**
      * @see ModelTransformer#transformToDomainModel(java.util.List, java.util.List)
      */
@@ -110,6 +112,15 @@
             throw new IllegalArgumentException( "properties: null" );
         }
 
+        if( eventListeners == null )
+        {
+            eventListeners = new ArrayList<ModelEventListener>();
+        }
+        else
+        {
+            eventListeners = new ArrayList<ModelEventListener>(eventListeners);
+        }
+
         List<ModelProperty> props = new ArrayList<ModelProperty>( properties
);
 
         //dependency management
@@ -185,7 +196,7 @@
         {
             ModelDataSource executionSource = new DefaultModelDataSource();
             executionSource.init( pluginContainer.getProperties(),
-                                  Arrays.asList( new ArtifactModelContainerFactory(), new
IdModelContainerFactory() ) );
+                                  Arrays.asList( new ArtifactModelContainerFactory(), new
PluginExecutionIdModelContainerFactory() ) );
             List<ModelContainer> executionContainers =
                 executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri
);
             if ( executionContainers.size() < 2 )
@@ -208,6 +219,16 @@
             }
         }
         props.removeAll( removeProperties );
+        for(ModelEventListener listener : eventListeners)
+        {
+            ModelDataSource ds = new DefaultModelDataSource();
+            ds.init( props, listener.getModelContainerFactories() );
+            for(String uri : listener.getUris() )
+            {
+                listener.fire(ds.queryFor(uri));
+            }
+        }
+
         return factory.createDomainModel( props );
     }
 
@@ -276,7 +297,7 @@
             {
                 List<ModelProperty> removeProperties = new ArrayList<ModelProperty>();
                 ModelDataSource source = new DefaultModelDataSource();
-                source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new
IdModelContainerFactory() ) );
+                source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new
PluginExecutionIdModelContainerFactory() ) );
                 List<ModelContainer> containers =
                     source.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri
);
                 for ( ModelContainer container : containers )



Mime
View raw message