mirror of https://github.com/apache/maven.git
Added #set to URI configurations. Fixed problem where execution rule was joining all collections, not just goals.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@736578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c688a8266d
commit
34aceea2eb
|
@ -361,11 +361,12 @@ public class PomTransformer
|
|||
Arrays.asList(new IdModelContainerFactory(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri),
|
||||
new AlwaysJoinModelContainerFactory()));
|
||||
for(ModelContainer es : executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri )) {
|
||||
ModelContainerRule rule = new ExecutionRule();
|
||||
ExecutionRule rule = new ExecutionRule();
|
||||
//List<ModelProperty> x = rule.execute(es.getProperties());
|
||||
List<ModelProperty> x = (!foobar.containsAll(es.getProperties())) ? rule.execute(es.getProperties()) :
|
||||
ModelTransformerContext.sort(rule.execute(es.getProperties()),
|
||||
ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri);
|
||||
|
||||
dataSource.replace(es, es.createNewInstance(x));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,7 +398,7 @@ public class ProjectUri
|
|||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
||||
public static String configuration =
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/execution#collection/execution/configuration";
|
||||
"http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/execution#collection/execution/configuration#set";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -524,7 +524,7 @@ public class ProjectUri
|
|||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
||||
public static String configuration =
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/configuration";
|
||||
"http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/configuration#set";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -788,7 +788,7 @@ public class ProjectUri
|
|||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
||||
public static String configuration =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/configuration";
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/configuration#set";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -915,7 +915,7 @@ public class ProjectUri
|
|||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/inherited";
|
||||
|
||||
public static String configuration =
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/configuration";
|
||||
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/configuration#set";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,11 @@ public class ExecutionRule implements ModelContainerRule {
|
|||
for(ModelProperty mp : properties) {
|
||||
if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.goal)) {
|
||||
goalProperties.add(mp);
|
||||
} else if(!containsProperty(mp, processedProperties)) {
|
||||
} else if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI)) {
|
||||
if(!containsProperty(mp, processedProperties)) {
|
||||
processedProperties.add(mp);
|
||||
}
|
||||
} else {
|
||||
processedProperties.add(mp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -297,6 +297,7 @@ public final class PomClassicDomainModel
|
|||
s.add(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri);
|
||||
s.add(ProjectUri.Build.Plugins.Plugin.Executions.xUri);
|
||||
s.add(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI);
|
||||
s.add(ProjectUri.Build.Plugins.Plugin.Executions.Execution.configuration);
|
||||
modelProperties = ModelMarshaller.marshallXmlToModelProperties(
|
||||
getInputStream(), ProjectUri.baseUri, s );
|
||||
}
|
||||
|
|
|
@ -106,6 +106,14 @@ public class PomConstructionTest
|
|||
assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() );
|
||||
}
|
||||
//*/
|
||||
|
||||
/** MNG-3965 */
|
||||
public void testExecutionConfigurationSubcollections()
|
||||
throws Exception
|
||||
{
|
||||
PomTestWrapper pom = buildPom( "execution-configuration-subcollections" );
|
||||
}
|
||||
|
||||
/** MNG-3985 */
|
||||
public void testMultipleRepositories()
|
||||
throws Exception
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<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/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nexus</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Nexus Repository Manager</name>
|
||||
<version>1.1-M1</version>
|
||||
|
||||
<!-- build information for the project -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>enforce</goal>
|
||||
</goals>
|
||||
<id>enforce</id>
|
||||
<configuration>
|
||||
<rules>
|
||||
<bannedDependencies>
|
||||
<excludes>
|
||||
<exclude>commons-logging:*</exclude>
|
||||
</excludes>
|
||||
<message>a</message>
|
||||
</bannedDependencies>
|
||||
<bannedDependencies>
|
||||
<excludes>
|
||||
<exclude>*:plexus-component-api</exclude>
|
||||
</excludes>
|
||||
</bannedDependencies>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
Loading…
Reference in New Issue