mirror of https://github.com/apache/maven.git
Added in listeners to PomTransformers. Fixed a couple of rules.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@719487 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5400908c56
commit
443d49730e
|
@ -99,6 +99,8 @@ public final class PomTransformer
|
||||||
|
|
||||||
ProjectUri.Repositories.xUri) ));
|
ProjectUri.Repositories.xUri) ));
|
||||||
|
|
||||||
|
private static Map<String, List<ModelProperty>> cache = new HashMap<String, List<ModelProperty>>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ModelTransformer#transformToDomainModel(java.util.List, java.util.List)
|
* @see ModelTransformer#transformToDomainModel(java.util.List, java.util.List)
|
||||||
*/
|
*/
|
||||||
|
@ -110,6 +112,15 @@ public final class PomTransformer
|
||||||
throw new IllegalArgumentException( "properties: null" );
|
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 );
|
List<ModelProperty> props = new ArrayList<ModelProperty>( properties );
|
||||||
|
|
||||||
//dependency management
|
//dependency management
|
||||||
|
@ -185,7 +196,7 @@ public final class PomTransformer
|
||||||
{
|
{
|
||||||
ModelDataSource executionSource = new DefaultModelDataSource();
|
ModelDataSource executionSource = new DefaultModelDataSource();
|
||||||
executionSource.init( pluginContainer.getProperties(),
|
executionSource.init( pluginContainer.getProperties(),
|
||||||
Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
|
Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ) );
|
||||||
List<ModelContainer> executionContainers =
|
List<ModelContainer> executionContainers =
|
||||||
executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
|
executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
|
||||||
if ( executionContainers.size() < 2 )
|
if ( executionContainers.size() < 2 )
|
||||||
|
@ -208,6 +219,16 @@ public final class PomTransformer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
props.removeAll( removeProperties );
|
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 );
|
return factory.createDomainModel( props );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,7 +297,7 @@ public final class PomTransformer
|
||||||
{
|
{
|
||||||
List<ModelProperty> removeProperties = new ArrayList<ModelProperty>();
|
List<ModelProperty> removeProperties = new ArrayList<ModelProperty>();
|
||||||
ModelDataSource source = new DefaultModelDataSource();
|
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 =
|
List<ModelContainer> containers =
|
||||||
source.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
|
source.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
|
||||||
for ( ModelContainer container : containers )
|
for ( ModelContainer container : containers )
|
||||||
|
|
Loading…
Reference in New Issue