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/02/01 15:59:40 UTC
svn commit: r739771 [4/10] - in /maven/components/branches/MNG-3932: ./
apache-maven/ apache-maven/src/ apache-maven/src/.cd/ apache-maven/src/bin/
apache-maven/src/conf/ apache-maven/src/main/
apache-maven/src/main/assembly/ apache-maven/src/site/ apa...
Added: maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom?rev=739771&view=auto
==============================================================================
--- maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom (added)
+++ maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/10/maven-plugins-10.pom Sun Feb 1 14:59:32 2009
@@ -0,0 +1,185 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements. See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership. The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied. See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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>
+ <parent>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-parent</artifactId>
+ <version>7</version>
+ <relativePath>../pom/maven/pom.xml</relativePath>
+ </parent>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugins</artifactId>
+ <packaging>pom</packaging>
+ <version>10</version>
+ <name>Maven Plugins</name>
+ <description>Maven Plugins</description>
+ <url>http://maven.apache.org/plugins/</url>
+ <mailingLists>
+ <mailingList>
+ <name>Maven User List</name>
+ <subscribe>users-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>users-unsubscribe@maven.apache.org</unsubscribe>
+ <post>users@maven.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-users</archive>
+ <otherArchives>
+ <otherArchive>http://www.mail-archive.com/users@maven.apache.org/</otherArchive>
+ <otherArchive>http://www.nabble.com/Maven---Users-f178.html</otherArchive>
+ </otherArchives>
+ </mailingList>
+ <mailingList>
+ <name>Maven Developer List</name>
+ <subscribe>dev-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>dev-unsubscribe@maven.apache.org</unsubscribe>
+ <post>dev@maven.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Commits List</name>
+ <subscribe>commits-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>commits-unsubscribe@maven.apache.org</unsubscribe>
+ <post>commits@maven.apache.org</post>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-dev</archive>
+ </mailingList>
+ <!-- duplication from parent pom - temporary until they inherit properly -->
+ <mailingList>
+ <name>Maven Announcements List</name>
+ <post>announce@maven.apache.org</post>
+ <subscribe>announce-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>announce-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-announce/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Issues List</name>
+ <post>issues@maven.apache.org</post>
+ <subscribe>issues-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>issues-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-issues/</archive>
+ </mailingList>
+ <mailingList>
+ <name>Maven Notifications List</name>
+ <post>notifications@maven.apache.org</post>
+ <subscribe>notifications-subscribe@maven.apache.org</subscribe>
+ <unsubscribe>notifications-unsubscribe@maven.apache.org</unsubscribe>
+ <archive>http://mail-archives.apache.org/mod_mbox/maven-notifications/</archive>
+ </mailingList>
+ </mailingLists>
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>scp://people.apache.org/www/maven.apache.org/plugins/</url>
+ </site>
+ </distributionManagement>
+ <modules>
+ <module>maven-ant-plugin</module>
+ <module>maven-antrun-plugin</module>
+ <module>maven-assembly-plugin</module>
+ <module>maven-changelog-plugin</module>
+ <module>maven-changes-plugin</module>
+ <module>maven-checkstyle-plugin</module>
+ <module>maven-clean-plugin</module>
+ <module>maven-compiler-plugin</module>
+ <module>maven-dependency-plugin</module>
+ <module>maven-deploy-plugin</module>
+ <module>maven-doap-plugin</module>
+ <module>maven-docck-plugin</module>
+ <module>maven-ear-plugin</module>
+ <module>maven-eclipse-plugin</module>
+ <module>maven-ejb-plugin</module>
+ <module>maven-gpg-plugin</module>
+ <module>maven-help-plugin</module>
+ <module>maven-idea-plugin</module>
+ <module>maven-install-plugin</module>
+ <module>maven-invoker-plugin</module>
+ <module>maven-jar-plugin</module>
+ <module>maven-javadoc-plugin</module>
+ <module>maven-one-plugin</module>
+ <module>maven-plugin-plugin</module>
+ <module>maven-pmd-plugin</module>
+ <module>maven-project-info-reports-plugin</module>
+ <module>maven-rar-plugin</module>
+ <module>maven-remote-resources-plugin</module>
+ <module>maven-repository-plugin</module>
+ <module>maven-resources-plugin</module>
+ <module>maven-site-plugin</module>
+ <module>maven-source-plugin</module>
+ <module>maven-stage-plugin</module>
+ <module>maven-verifier-plugin</module>
+ <module>maven-war-plugin</module>
+ </modules>
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-plugins-10</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-plugins-10</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/maven/plugins/tags/maven-plugins-10</url>
+ </scm>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <tagBase>https://svn.apache.org/repos/asf/maven/plugins/tags</tagBase>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-5</version>
+ <configuration>
+ <stagingSiteURL>scp://people.apache.org/www/maven.apache.org/plugins/${artifactId}-${version}</stagingSiteURL>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <profiles>
+ <profile>
+ <id>ciProfile</id>
+ <activation>
+ <property>
+ <name>enableCiProfile</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-docck-plugin</artifactId>
+ <version>1.0-beta-2</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Added: maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/maven-metadata.xml?rev=739771&view=auto
==============================================================================
--- maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/maven-metadata.xml (added)
+++ maven/components/branches/MNG-3932/maven-mercury/src/test/resources/repo/org/apache/maven/plugins/maven-plugins/maven-metadata.xml Sun Feb 1 14:59:32 2009
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><metadata>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugins</artifactId>
+ <versioning>
+ <latest>10</latest>
+ <release>10</release>
+ <versions>
+ <version>10</version>
+ </versions>
+ <lastUpdated>20080122220618</lastUpdated>
+ </versioning>
+</metadata>
\ No newline at end of file
Modified: maven/components/branches/MNG-3932/maven-model/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-model/pom.xml?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-model/pom.xml (original)
+++ maven/components/branches/MNG-3932/maven-model/pom.xml Sun Feb 1 14:59:32 2009
@@ -19,8 +19,7 @@
under the License.
-->
-<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">
+<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">
<parent>
<artifactId>maven</artifactId>
<groupId>org.apache.maven</groupId>
Modified: maven/components/branches/MNG-3932/maven-model/src/main/mdo/maven.mdo
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-model/src/main/mdo/maven.mdo?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-model/src/main/mdo/maven.mdo (original)
+++ maven/components/branches/MNG-3932/maven-model/src/main/mdo/maven.mdo Sun Feb 1 14:59:32 2009
@@ -51,8 +51,8 @@
<p>This is a reference for the Maven project descriptor used in Maven.</p>
<p>An XSD is available at:</p>
<ul>
- <li><a href="http://maven.apache.org/maven-v3_0_0.xsd">http://maven.apache.org/maven-v3_0_0.xsd</a> for Maven 1.1.</li>
- <li><a href="http://maven.apache.org/maven-v4_0_0.xsd">http://maven.apache.org/maven-v4_0_0.xsd</a> for Maven 2.0.</li>
+ <li><a href="http://maven.apache.org/xsd/maven-v3_0_0.xsd">http://maven.apache.org/xsd/maven-v3_0_0.xsd</a> for Maven 1.1.</li>
+ <li><a href="http://maven.apache.org/xsd/maven-4.0.0.xsd">http://maven.apache.org/xsd/maven-4.0.0.xsd</a> for Maven 2.0.</li>
</ul>
]]>
</description>
@@ -761,7 +761,7 @@
{
if ( pluginMap == null )
{
- pluginMap = new java.util.HashMap();
+ pluginMap = new java.util.LinkedHashMap();
if ( plugins != null )
{
for ( java.util.Iterator it = plugins.iterator(); it.hasNext(); )
@@ -2126,7 +2126,7 @@
<description>
<![CDATA[
FOR INTERNAL USE ONLY. This is a unique identifier assigned to each
- resource to allow Maven to merge changes to this resource that take
+ resource to allow Maven to merge changes to this resource that take
place during the execution of a plugin. This field must be managed
by the generated parser and formatter classes in order to allow it
to survive model interpolation.
@@ -2141,7 +2141,7 @@
<code>
<![CDATA[
private static int mergeIdCounter = 0;
-
+
public void initMergeId()
{
if ( getMergeId() == null )
@@ -2149,7 +2149,7 @@
setMergeId( "resource-" + (mergeIdCounter++) );
}
}
-
+
/**
* @see java.lang.Object#toString()
*/
@@ -2639,7 +2639,7 @@
{
if ( executionMap == null )
{
- executionMap = new java.util.HashMap();
+ executionMap = new java.util.LinkedHashMap();
if ( getExecutions() != null )
{
for ( java.util.Iterator i = getExecutions().iterator(); i.hasNext(); )
@@ -2733,7 +2733,7 @@
<name>id</name>
<version>4.0.0</version>
<type>String</type>
- <defaultValue>default</defaultValue>
+ <defaultValue>default-execution-id</defaultValue>
<description>The identifier of this execution for labelling the goals during the build,
and for matching executions to merge during inheritance.</description>
</field>
@@ -2759,7 +2759,7 @@
<version>4.0.0</version>
<code>
<![CDATA[
- public static final String DEFAULT_EXECUTION_ID = "default";
+ public static final String DEFAULT_EXECUTION_ID = "default-execution-id";
]]>
</code>
</codeSegment>
@@ -2850,7 +2850,7 @@
{
if ( reportPluginMap == null )
{
- reportPluginMap = new java.util.HashMap();
+ reportPluginMap = new java.util.LinkedHashMap();
if ( getPlugins() != null )
{
for ( java.util.Iterator it = getPlugins().iterator(); it.hasNext(); )
@@ -2988,6 +2988,8 @@
<type>ActivationFile</type>
</association>
</field>
+ <!--
+ This could be included once we teach Maven to deal with multiple versions of the model
<field>
<name>custom</name>
<version>4.0.0</version>
@@ -2997,6 +2999,7 @@
<type>ActivationCustom</type>
</association>
</field>
+ -->
</fields>
</class>
<class>
@@ -3088,6 +3091,8 @@
</field>
</fields>
</class>
+ <!--
+ This can be put back in when we figure out how to have multiple model versions
<class>
<name>ActivationCustom</name>
<version>4.0.0</version>
@@ -3109,6 +3114,7 @@
</field>
</fields>
</class>
+ -->
<!-- /BuildProfile support -->
<class xml.tagName="plugin">
<name>ReportPlugin</name>
@@ -3191,7 +3197,7 @@
{
if ( reportSetMap == null )
{
- reportSetMap = new java.util.HashMap();
+ reportSetMap = new java.util.LinkedHashMap();
if ( getReportSets() != null )
{
for ( java.util.Iterator i = getReportSets().iterator(); i.hasNext(); )
Modified: maven/components/branches/MNG-3932/maven-model/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-model/src/site/apt/index.apt?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-model/src/site/apt/index.apt (original)
+++ maven/components/branches/MNG-3932/maven-model/src/site/apt/index.apt Sun Feb 1 14:59:32 2009
@@ -17,4 +17,4 @@
* A {{{maven.html}Descriptor Reference}}
- * An XSD {{{http://maven.apache.org/maven-v3_0_0.xsd}for Maven 1.1}} and {{{http://maven.apache.org/maven-v4_0_0.xsd}for Maven 2.0}}.
+ * An XSD {{{http://maven.apache.org/xsd/maven-v3_0_0.xsd}for Maven 1.1}} and {{{http://maven.apache.org/xsd/maven-4.0.0.xsd}for Maven 2.0}}.
Propchange: maven/components/branches/MNG-3932/maven-model/src/site/site.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/MNG-3932/maven-plugin-api/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-plugin-api/pom.xml?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-plugin-api/pom.xml (original)
+++ maven/components/branches/MNG-3932/maven-plugin-api/pom.xml Sun Feb 1 14:59:32 2009
@@ -19,8 +19,7 @@
under the License.
-->
-<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">
+<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">
<parent>
<artifactId>maven</artifactId>
<groupId>org.apache.maven</groupId>
Propchange: maven/components/branches/MNG-3932/maven-plugin-api/src/site/site.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/MNG-3932/maven-project-builder/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/pom.xml?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/pom.xml (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/pom.xml Sun Feb 1 14:59:32 2009
@@ -10,8 +10,7 @@
governing permissions and limitations under the License.
-->
-<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">
+<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">
<parent>
<artifactId>maven</artifactId>
<groupId>org.apache.maven</groupId>
Propchange: maven/components/branches/MNG-3932/maven-project-builder/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/AlwaysJoinModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/AlwaysJoinModelContainerFactory.java?rev=739771&view=auto
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/AlwaysJoinModelContainerFactory.java (added)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/AlwaysJoinModelContainerFactory.java Sun Feb 1 14:59:32 2009
@@ -0,0 +1,62 @@
+package org.apache.maven.project.builder;
+
+import org.apache.maven.shared.model.ModelContainerFactory;
+import org.apache.maven.shared.model.ModelContainer;
+import org.apache.maven.shared.model.ModelProperty;
+import org.apache.maven.shared.model.ModelContainerAction;
+
+import java.util.*;
+
+public class AlwaysJoinModelContainerFactory
+ implements ModelContainerFactory
+{
+
+ private static final Collection<String> uris = Collections.unmodifiableList( Arrays.asList(
+
+ ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.goal
+ // ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri
+
+ ) );
+
+ public Collection<String> getUris()
+ {
+ return uris;
+ }
+
+ public ModelContainer create( List<ModelProperty> modelProperties )
+ {
+ if ( modelProperties == null || modelProperties.size() == 0 )
+ {
+ throw new IllegalArgumentException( "modelProperties: null or empty" );
+ }
+ return new Anon_ModelContainer( modelProperties );
+ }
+
+ private static class Anon_ModelContainer
+ implements ModelContainer
+ {
+
+ public Anon_ModelContainer(List<ModelProperty> properties) {
+ this.properties = new ArrayList<ModelProperty>(properties);
+ }
+
+ private List<ModelProperty> properties;
+
+
+ public ModelContainerAction containerAction( ModelContainer modelContainer )
+ {
+ return ModelContainerAction.JOIN;
+ }
+
+ public ModelContainer createNewInstance( List<ModelProperty> modelProperties )
+ {
+ return new Anon_ModelContainer( modelProperties );
+ }
+
+ public List<ModelProperty> getProperties()
+ {
+ return new ArrayList<ModelProperty>(properties);
+ }
+
+ }
+}
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ArtifactModelContainerFactory.java Sun Feb 1 14:59:32 2009
@@ -35,20 +35,27 @@
{
private static final Collection<String> uris = Collections.unmodifiableList( Arrays.asList(
- ProjectUri.DependencyManagement.Dependencies.Dependency.xUri, ProjectUri.Dependencies.Dependency.xUri,
+ ProjectUri.DependencyManagement.Dependencies.Dependency.xUri,
+ ProjectUri.Dependencies.Dependency.xUri,
ProjectUri.Reporting.Plugins.Plugin.xUri,
ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri,
- //ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.xUri,
-
- ProjectUri.Build.Plugins.Plugin.xUri,
- //ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.xUri,
- // ProjectUri.Build.Plugins.Plugin.Dependencies.Dependency.Exclusions.Exclusion.xUri,
+ ProjectUri.Build.Plugins.Plugin.xUri,
ProjectUri.Build.Extensions.Extension.xUri
) );
+ private final Collection<String> u;
+
public Collection<String> getUris()
{
- return uris;
+ return u;
+ }
+
+ public ArtifactModelContainerFactory() {
+ u = uris;
+ }
+
+ public ArtifactModelContainerFactory(String uri) {
+ u = Collections.unmodifiableList( Arrays.asList(uri) );
}
public ModelContainer create( List<ModelProperty> modelProperties )
@@ -75,6 +82,8 @@
private String scope;
private String classifier;
+
+ private String uri;
private List<ModelProperty> properties;
@@ -95,7 +104,7 @@
{
this.properties = new ArrayList<ModelProperty>( properties );
this.properties = Collections.unmodifiableList( this.properties );
- String uri = findBaseUriFrom( this.properties );
+ uri = findBaseUriFrom( this.properties );
for ( ModelProperty mp : this.properties )
{
@@ -193,7 +202,8 @@
if ( c.groupId.equals( groupId ) && c.artifactId.equals( artifactId ) && c.type.equals( type )
&& c.classifier.equals( classifier ))
{
- if ( c.version.equals( version ) || version.equals("") || c.version.equals(""))
+ if ( uri.startsWith(ProjectUri.Build.Plugins.xUri) || c.version.equals( version )
+ || version.equals("") || c.version.equals(""))
{
return ModelContainerAction.JOIN;
}
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java Sun Feb 1 14:59:32 2009
@@ -7,7 +7,7 @@
import java.util.*;
-public class ExclusionModelContainerFactory implements ModelContainerFactory
+public class ExclusionModelContainerFactory implements ModelContainerFactory
{
private static final Collection<String> uris = Collections.unmodifiableList( Arrays.asList(
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/IdModelContainerFactory.java Sun Feb 1 14:59:32 2009
@@ -34,16 +34,27 @@
implements ModelContainerFactory
{
- private static final Collection<String> uris = Collections.unmodifiableList( Arrays.asList(
- ProjectUri.PluginRepositories.PluginRepository.xUri,
- ProjectUri.Repositories.Repository.xUri,
- ProjectUri.Reporting.Plugins.Plugin.ReportSets.ReportSet.xUri,
- ProjectUri.Profiles.Profile.xUri,
- ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri ) );
-
+ private String uri;
+
+ public IdModelContainerFactory(String uri)
+ {
+ if(uri == null)
+ {
+ throw new IllegalArgumentException("uri: null");
+ }
+ this.uri = uri;
+ }
+
+ public static final List<IdModelContainerFactory> ID_CONTAINER_FACTORIES =
+ Collections.unmodifiableList(Arrays.asList(new IdModelContainerFactory(ProjectUri.PluginRepositories.PluginRepository.xUri),
+ new IdModelContainerFactory(ProjectUri.Repositories.Repository.xUri),
+ new IdModelContainerFactory(ProjectUri.Reporting.Plugins.Plugin.ReportSets.ReportSet.xUri),
+ new IdModelContainerFactory(ProjectUri.Profiles.Profile.xUri),
+ new IdModelContainerFactory(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri)));
+
public Collection<String> getUris()
{
- return uris;
+ return Collections.unmodifiableList(Arrays.asList(uri));
}
public ModelContainer create( List<ModelProperty> modelProperties )
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java Sun Feb 1 14:59:32 2009
@@ -19,28 +19,14 @@
* under the License.
*/
+import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.shared.model.DomainModel;
-import org.apache.maven.shared.model.DomainModelFactory;
-import org.apache.maven.shared.model.InterpolatorProperty;
-import org.apache.maven.shared.model.ModelContainer;
-import org.apache.maven.shared.model.ModelContainerAction;
-import org.apache.maven.shared.model.ModelDataSource;
-import org.apache.maven.shared.model.ModelEventListener;
-import org.apache.maven.shared.model.ModelProperty;
-import org.apache.maven.shared.model.ModelTransformer;
-import org.apache.maven.shared.model.ModelTransformerContext;
+import java.util.*;
+
+import org.apache.maven.shared.model.*;
import org.apache.maven.shared.model.impl.DefaultModelDataSource;
+import org.apache.maven.project.builder.rules.ExecutionRule;
+import org.apache.maven.project.builder.rules.DependencyRule;
/**
* Provides methods for transforming model properties into a domain model for the pom classic format and vice versa.
@@ -55,13 +41,54 @@
{
this.factory = factory;
}
-
+
+ public static final List<ModelContainerFactory> MODEL_CONTAINER_FACTORIES =
+ Collections.unmodifiableList(Arrays.asList(new ArtifactModelContainerFactory(),
+ new IdModelContainerFactory(ProjectUri.PluginRepositories.PluginRepository.xUri),
+ new IdModelContainerFactory(ProjectUri.Repositories.Repository.xUri),
+ new IdModelContainerFactory(ProjectUri.Reporting.Plugins.Plugin.ReportSets.ReportSet.xUri),
+ new IdModelContainerFactory(ProjectUri.Profiles.Profile.xUri),
+ new IdModelContainerFactory(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri)));
+
+ private static Collection<ModelContainerInfo> goals_infos = Arrays.asList(
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new AlwaysJoinModelContainerFactory(), new ExecutionRule(), null)
+ );
+
+ private static Collection<ModelContainerInfo> plugin_executions = Arrays.asList(
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new IdModelContainerFactory(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri),
+ null, goals_infos)
+ );
+
+ private static Collection<ModelContainerInfo> dependency_exclusions = Arrays.asList(
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new IdModelContainerFactory(ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.Exclusion.xUri),
+ new DependencyRule(), null)
+ );
+
+ //Don't add subcontainers here, breaks MNG-3821
+ public static final Collection<ModelContainerInfo> MODEL_CONTAINER_INFOS = Arrays.asList(
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new ArtifactModelContainerFactory(), null, plugin_executions),
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new IdModelContainerFactory(ProjectUri.PluginRepositories.PluginRepository.xUri), null, null),
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new IdModelContainerFactory(ProjectUri.Repositories.Repository.xUri), null, null),
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new ArtifactModelContainerFactory(), null, dependency_exclusions),
+ ModelContainerInfo.Factory.createModelContainerInfo(
+ new IdModelContainerFactory(ProjectUri.Profiles.Profile.xUri), null, null)
+ );
+
/**
* The URIs this transformer supports
*/
public static final Set<String> URIS = Collections.unmodifiableSet(new HashSet<String>( Arrays.asList( ProjectUri.Build.Extensions.xUri,
ProjectUri.Build.PluginManagement.Plugins.xUri,
ProjectUri.Build.PluginManagement.Plugins.Plugin.configuration,
+ ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri,
+ ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.Goals.xURI,
ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.xUri,
ProjectUri.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri,
@@ -75,15 +102,17 @@
ProjectUri.Build.Resources.Resource.excludes,
ProjectUri.Build.TestResources.xUri,
+ ProjectUri.Build.Filters.xUri,
+
ProjectUri.CiManagement.Notifiers.xUri,
ProjectUri.Contributors.xUri,
ProjectUri.Dependencies.xUri,
- ProjectUri.Dependencies.Dependency.Exclusions.xUri,
+ // ProjectUri.Dependencies.Dependency.Exclusions.xUri,
ProjectUri.DependencyManagement.Dependencies.xUri,
- ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.xUri,
+ // ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.xUri,
ProjectUri.Developers.xUri,
ProjectUri.Developers.Developer.roles,
@@ -99,25 +128,43 @@
ProjectUri.Profiles.Profile.Build.Resources.xUri,
ProjectUri.Profiles.Profile.Build.TestResources.xUri,
ProjectUri.Profiles.Profile.Dependencies.xUri,
- ProjectUri.Profiles.Profile.Dependencies.Dependency.Exclusions.xUri,
+ // ProjectUri.Profiles.Profile.Dependencies.Dependency.Exclusions.xUri,
ProjectUri.Profiles.Profile.DependencyManagement.Dependencies.xUri,
- ProjectUri.Profiles.Profile.DependencyManagement.Dependencies.Dependency.Exclusions.xUri,
+ // ProjectUri.Profiles.Profile.DependencyManagement.Dependencies.Dependency.Exclusions.xUri,
ProjectUri.Profiles.Profile.PluginRepositories.xUri,
ProjectUri.Profiles.Profile.Reporting.Plugins.xUri,
- ProjectUri.Profiles.Profile.Reporting.Plugins.Plugin.ReportSets.xUri,
+ //ProjectUri.Profiles.Profile.Reporting.Plugins.Plugin.ReportSets.xUri,
ProjectUri.Profiles.Profile.Repositories.xUri,
ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.xUri,
- ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Executions.xUri,
+ // ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Executions.xUri,
+ // ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Executions.Execution.Goals.xURI,
ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Dependencies.xUri,
- ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri,
+ // ProjectUri.Profiles.Profile.Build.PluginManagement.Plugins.Plugin.Dependencies.Dependency.Exclusions.xUri,
ProjectUri.Reporting.Plugins.xUri,
- ProjectUri.Reporting.Plugins.Plugin.ReportSets.xUri,
+ //ProjectUri.Reporting.Plugins.Plugin.ReportSets.xUri,
ProjectUri.Repositories.xUri) ));
/**
+ * The URIs that denote file/directory paths and need their file separators being normalized.
+ */
+ private static final Set<String> PATH_URIS =
+ Collections.unmodifiableSet( new HashSet<String>(
+ Arrays.asList(
+ ProjectUri.Build.directory,
+ ProjectUri.Build.outputDirectory,
+ ProjectUri.Build.testOutputDirectory,
+ ProjectUri.Build.sourceDirectory,
+ ProjectUri.Build.testSourceDirectory,
+ ProjectUri.Build.scriptSourceDirectory,
+ ProjectUri.Build.Resources.Resource.directory,
+ ProjectUri.Build.TestResources.TestResource.directory,
+ ProjectUri.Build.Filters.filter,
+ ProjectUri.Reporting.outputDirectory ) ) );
+
+ /**
* @see ModelTransformer#transformToDomainModel(java.util.List, java.util.List)
*/
public final DomainModel transformToDomainModel( List<ModelProperty> properties, List<? extends ModelEventListener> eventListeners )
@@ -140,16 +187,32 @@
List<ModelProperty> props = new ArrayList<ModelProperty>( properties );
//dependency management
- ModelDataSource source = new DefaultModelDataSource();
- source.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
+ ModelDataSource source = new DefaultModelDataSource( props, PomTransformer.MODEL_CONTAINER_FACTORIES );
for ( ModelContainer dependencyContainer : source.queryFor( ProjectUri.Dependencies.Dependency.xUri ) )
{
for ( ModelContainer managementContainer : source.queryFor(
ProjectUri.DependencyManagement.Dependencies.Dependency.xUri ) )
{
+ //Join Duplicate Exclusions Rule (MNG-4010)
+ ModelDataSource exclusionSource = new DefaultModelDataSource(managementContainer.getProperties(),
+ Collections.unmodifiableList(Arrays.asList(new ArtifactModelContainerFactory(ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.Exclusion.xUri))));
+ List<ModelContainer> exclusionContainers =
+ exclusionSource.queryFor(ProjectUri.DependencyManagement.Dependencies.Dependency.Exclusions.Exclusion.xUri);
+
+ for(ModelContainer mc : exclusionContainers)
+ {
+ for(ModelContainer mc1 : exclusionContainers)
+ {
+ if(!mc.equals(mc1) && mc.containerAction(mc1).equals(ModelContainerAction.JOIN))
+ {
+ exclusionSource.joinWithOriginalOrder(mc1, mc);
+ }
+ }
+ }
+
managementContainer = new ArtifactModelContainerFactory().create(
- transformDependencyManagement( managementContainer.getProperties() ) );
+ transformDependencyManagement( exclusionSource.getModelProperties() ) );
ModelContainerAction action = dependencyContainer.containerAction( managementContainer );
if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) )
{
@@ -158,6 +221,7 @@
}
}
+ List<ModelProperty> joinedContainers = new ArrayList<ModelProperty>();
for ( ModelContainer pluginContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) )
{
for ( ModelContainer managementContainer : source.queryFor( ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri ) )
@@ -210,13 +274,8 @@
if ( action.equals( ModelContainerAction.JOIN ) || action.equals( ModelContainerAction.DELETE ) )
{
- ModelDataSource pluginDatasource = new DefaultModelDataSource();
- pluginDatasource.init( pluginContainer.getProperties(), Arrays.asList( new ArtifactModelContainerFactory(),
- new IdModelContainerFactory() ) );
-
- ModelDataSource managementDatasource = new DefaultModelDataSource();
- managementDatasource.init( managementContainer.getProperties(), Arrays.asList( new ArtifactModelContainerFactory(),
- new IdModelContainerFactory() ) );
+ ModelDataSource pluginDatasource = new DefaultModelDataSource( pluginContainer.getProperties(), PomTransformer.MODEL_CONTAINER_FACTORIES );
+ ModelDataSource managementDatasource = new DefaultModelDataSource( managementContainer.getProperties(), PomTransformer.MODEL_CONTAINER_FACTORIES );
List<ModelContainer> managementExecutionContainers = managementDatasource.queryFor(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri);
List<ModelProperty> managementPropertiesWithoutExecutions = new ArrayList<ModelProperty>(managementContainer.getProperties());
@@ -225,18 +284,35 @@
managementPropertiesWithoutExecutions.removeAll(a.getProperties());
}
- source.join( pluginContainer, new ArtifactModelContainerFactory().create(managementPropertiesWithoutExecutions) );
+ source.joinWithOriginalOrder( pluginContainer, new ArtifactModelContainerFactory().create(managementPropertiesWithoutExecutions) );
List<ModelContainer> pluginExecutionContainers = pluginDatasource.queryFor(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri);
List<ModelContainer> joinedExecutionContainers = new ArrayList<ModelContainer>();
for(ModelContainer a : managementExecutionContainers)
{
+ boolean hasId = false;
+ for(ModelProperty mp : a.getProperties()) {
+ if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.id)) {
+ hasId = true;
+ break;
+ }
+ }
+
+ ModelContainer c = a;
+ if(!hasId) {
+ List<ModelProperty> listWithId = new ArrayList<ModelProperty>(a.getProperties());
+ listWithId.add(1, new ModelProperty(ProjectUri.Build.Plugins.Plugin.Executions.Execution.id, "default"));
+ c = new IdModelContainerFactory(ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri).create(listWithId);
+ }
+
+
for(ModelContainer b : pluginExecutionContainers)
{
- if(b.containerAction(a).equals(ModelContainerAction.JOIN))
+ if(b.containerAction(c).equals(ModelContainerAction.JOIN))
{
- source.join(b, a);
+ //MNG-3995 - property lost here
+ joinedContainers.addAll(source.join(b, c).getProperties());
joinedExecutionContainers.add(a);
}
}
@@ -272,6 +348,7 @@
ModelTransformerContext.sort(a.getProperties(), ProjectUri.Build.Plugins.Plugin.Executions.xUri));
}
}
+
}
}
}
@@ -281,18 +358,14 @@
//Rule: Do not join plugin executions without ids
Set<ModelProperty> removeProperties = new HashSet<ModelProperty>();
- ModelDataSource dataSource = new DefaultModelDataSource();
-
- dataSource.init( props, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
-
+ ModelDataSource dataSource = new DefaultModelDataSource( props, PomTransformer.MODEL_CONTAINER_FACTORIES );
+
List<ModelContainer> containers = dataSource.queryFor( ProjectUri.Build.Plugins.Plugin.xUri );
for ( ModelContainer pluginContainer : containers )
{
- ModelDataSource executionSource = new DefaultModelDataSource();
-
- executionSource.init( pluginContainer.getProperties(),
- Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ) );
+ ModelDataSource executionSource = new DefaultModelDataSource( pluginContainer.getProperties(),
+ Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ));
List<ModelContainer> executionContainers = executionSource.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
@@ -301,35 +374,102 @@
continue;
}
- boolean hasAtLeastOneWithoutId = true;
+ boolean hasAtLeastOneWithoutId = false;
for ( ModelContainer executionContainer : executionContainers )
{
- if ( hasAtLeastOneWithoutId )
- {
- hasAtLeastOneWithoutId = hasExecutionId( executionContainer );
- }
+
- if ( !hasAtLeastOneWithoutId && !hasExecutionId( executionContainer ) && executionContainers.indexOf( executionContainer ) > 0 )
+ if ( hasAtLeastOneWithoutId && !hasExecutionId( executionContainer ) && executionContainers.indexOf( executionContainer ) > 0 )
{
removeProperties.addAll( executionContainer.getProperties() );
}
+ if ( !hasAtLeastOneWithoutId )
+ {
+ hasAtLeastOneWithoutId = !hasExecutionId( executionContainer );
+ }
}
}
props.removeAll( removeProperties );
+ //Execution Rule - extension for this needs to be pushed into model-builder
+ dataSource = new DefaultModelDataSource( props, PomTransformer.MODEL_CONTAINER_FACTORIES );
+
+ for(ModelContainer mc : dataSource.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ))
+ {
+ ModelDataSource executionSource =
+ new DefaultModelDataSource(mc.getProperties(),
+ 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 )) {
+ ExecutionRule rule = new ExecutionRule();
+ // List<ModelProperty> x = rule.execute(es.getProperties());
+ List<ModelProperty> x = !aContainsAnyOfB(es.getProperties(), joinedContainers) ? rule.execute(es.getProperties()) :
+ ModelTransformerContext.sort(rule.execute(es.getProperties()),
+ ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri);
+
+ dataSource.replace(es, es.createNewInstance(x));
+ }
+ }
+
+ props =// false ? ModelTransformerContext.sort(dataSource.getModelProperties(), ProjectUri.baseUri)
+ dataSource.getModelProperties();
+
for(ModelEventListener listener : eventListeners)
{
- ModelDataSource ds = new DefaultModelDataSource();
- ds.init( props, listener.getModelContainerFactories() );
+ ModelDataSource ds = new DefaultModelDataSource( props, listener.getModelContainerFactories() );
for(String uri : listener.getUris() )
{
listener.fire(ds.queryFor(uri));
}
}
+
+ //Cleanup props (MNG-3979)
+ List<ModelProperty> p = new ArrayList<ModelProperty>();
+ for(ModelProperty mp : props)
+ {
+ if(mp.getResolvedValue() != null
+ && mp.getResolvedValue().trim().equals(""))
+ {
+ int index = props.indexOf(mp) + 1;
+
+ if(index <= props.size() && mp.isParentOf(props.get(index)) && mp.getDepth() != props.get(index).getDepth()
+ && !props.get(index).getUri().contains("#property"))
+ {
+ p.add(new ModelProperty(mp.getUri(), null));
+ }
+ else
+ {
+ p.add(mp);
+ }
+ }
+ else if ( mp.getResolvedValue() != null && PATH_URIS.contains( mp.getUri() ) )
+ {
+ // normalize file separator
+ p.add( new ModelProperty( mp.getUri(), new File( mp.getResolvedValue() ).getPath() ) );
+ }
+ else
+ {
+ p.add(mp);
+ }
+ }
- return factory.createDomainModel( props );
+ return factory.createDomainModel( p );
+ }
+
+ private static boolean aContainsAnyOfB(List<ModelProperty> a, List<ModelProperty> b) {
+ for(ModelProperty mpA : a )
+ {
+ for(ModelProperty mpB : b)
+ {
+ if(mpA.equals(mpB))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
}
private static List<ModelProperty> transformDependencyManagement( List<ModelProperty> modelProperties )
@@ -389,7 +529,39 @@
List<ModelProperty> tmp = domainModel.getModelProperties();
List clearedProperties = new ArrayList<ModelProperty>();
+
+ //Default Dependency Scope Rule
+ ModelDataSource s = new DefaultModelDataSource( tmp, Arrays.asList( new ArtifactModelContainerFactory()) );
+ for(ModelContainer mc : s.queryFor(ProjectUri.Dependencies.Dependency.xUri))
+ {
+ boolean containsScope = false;
+ for(ModelProperty mp :mc.getProperties())
+ {
+ if(mp.getUri().equals(ProjectUri.Dependencies.Dependency.scope)) {
+ containsScope = true;
+ break;
+ }
+ }
+
+ if(!containsScope)
+ {
+ tmp.add(tmp.indexOf(mc.getProperties().get(0)) + 1, new ModelProperty(ProjectUri.Dependencies.Dependency.scope, "compile"));
+ }
+ }
+
+ //Remove Default Executions IDS (mng-3965)
+ List<ModelProperty> replace = new ArrayList<ModelProperty>();
+ for(ModelProperty mp : tmp)
+ {
+ if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.id)
+ && mp.getResolvedValue() != null && mp.getResolvedValue().equals("default-execution-id")) {
+ replace.add(mp);
+ }
+ }
+
+ tmp.removeAll(replace);
+
//Missing Version Rule
if ( getPropertyFor( ProjectUri.version, tmp ) == null )
{
@@ -426,8 +598,7 @@
if ( domainModelIndex > 0 )
{
List<ModelProperty> removeProperties = new ArrayList<ModelProperty>();
- ModelDataSource source = new DefaultModelDataSource();
- source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ) );
+ ModelDataSource source = new DefaultModelDataSource( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new PluginExecutionIdModelContainerFactory() ));
List<ModelContainer> containers =
source.queryFor( ProjectUri.Build.Plugins.Plugin.Executions.Execution.xUri );
for ( ModelContainer container : containers )
@@ -456,8 +627,7 @@
if ( domainModelIndex > 0 )
{
List<ModelProperty> removeProperties = new ArrayList<ModelProperty>();
- ModelDataSource source = new DefaultModelDataSource();
- source.init( tmp, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
+ ModelDataSource source = new DefaultModelDataSource( tmp, PomTransformer.MODEL_CONTAINER_FACTORIES );
List<ModelContainer> containers = source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri );
for ( ModelContainer container : containers )
{
@@ -574,8 +744,7 @@
}
//Rule: Build plugin config overrides reporting plugin config
- ModelDataSource source = new DefaultModelDataSource();
- source.init( modelProperties, Arrays.asList( new ArtifactModelContainerFactory(), new IdModelContainerFactory() ) );
+ ModelDataSource source = new DefaultModelDataSource( modelProperties, PomTransformer.MODEL_CONTAINER_FACTORIES );
List<ModelContainer> reportContainers = source.queryFor( ProjectUri.Reporting.Plugins.Plugin.xUri );
for ( ModelContainer pluginContainer : source.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ) )
@@ -594,6 +763,7 @@
}
modelProperties = source.getModelProperties();
+
return modelProperties;
}
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java Sun Feb 1 14:59:32 2009
@@ -24,6 +24,12 @@
*/
public class ProjectUri
{
+
+ /*
+ * NOTE: The strings defined here are deliberately non-final to prevent the compiler from inlining them when
+ * downstream code compiles against them.
+ */
+
public static String baseUri = "http://apache.org/maven";
public static String xUri = "http://apache.org/maven/project";
@@ -109,7 +115,7 @@
"http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/address";
public static String configuration =
- "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/configuration";
+ "http://apache.org/maven/project/ciManagement/notifiers#collection/notifier/configuration#set";
}
}
}
@@ -342,7 +348,12 @@
public static String finalName = "http://apache.org/maven/project/build/finalName";
- public static String filters = "http://apache.org/maven/project/build/filters";
+ public static class Filters
+ {
+ public static String xUri = "http://apache.org/maven/project/build/filters#set";
+
+ public static String filter = xUri + "/filter";
+ }
public static class PluginManagement
{
@@ -398,7 +409,7 @@
"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 +535,7 @@
"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 +799,7 @@
"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";
}
}
@@ -859,7 +870,7 @@
"http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/inherited";
public static String configuration =
- "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/configuration";
+ "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/configuration#set";
}
}
}
@@ -915,7 +926,7 @@
"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";
}
}
@@ -986,7 +997,7 @@
"http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/inherited";
public static String configuration =
- "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/configuration";
+ "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/configuration#set";
}
}
}
@@ -995,108 +1006,108 @@
public static class Repositories
{
- public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/repositories";
+ public static String xUri = "http://apache.org/maven/project/profiles#collection/profile/repositories#collection";
public static class Repository
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository";
public static class Releases
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/releases";
public static String enabled =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/enabled";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/releases/enabled";
public static String updatePolicy =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/updatePolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/releases/updatePolicy";
public static String checksumPolicy =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/releases/checksumPolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/releases/checksumPolicy";
}
public static class Snapshots
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/snapshots";
public static String enabled =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/enabled";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/snapshots/enabled";
public static String updatePolicy =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/updatePolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/snapshots/updatePolicy";
public static String checksumPolicy =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/snapshots/checksumPolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/snapshots/checksumPolicy";
}
public static String id =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/id";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/id";
public static String name =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/name";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/name";
public static String url =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/url";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/url";
public static String layout =
- "http://apache.org/maven/project/profiles#collection/profile/repositories/repository/layout";
+ "http://apache.org/maven/project/profiles#collection/profile/repositories#collection/repository/layout";
}
}
public static class PluginRepositories
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection";
public static class PluginRepository
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository";
public static class Releases
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/releases";
public static String enabled =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/enabled";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/releases/enabled";
public static String updatePolicy =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/updatePolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/releases/updatePolicy";
public static String checksumPolicy =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/releases/checksumPolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/releases/checksumPolicy";
}
public static class Snapshots
{
public static String xUri =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/snapshots";
public static String enabled =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/enabled";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/snapshots/enabled";
public static String updatePolicy =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/updatePolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/snapshots/updatePolicy";
public static String checksumPolicy =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/snapshots/checksumPolicy";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/snapshots/checksumPolicy";
}
public static String id =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/id";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/id";
public static String name =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/name";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/name";
public static String url =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/url";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/url";
public static String layout =
- "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories/pluginRepository/layout";
+ "http://apache.org/maven/project/profiles#collection/profile/pluginRepositories#collection/pluginRepository/layout";
}
}
@@ -1188,7 +1199,7 @@
"http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/inherited";
public static String configuration =
- "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/configuration";
+ "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/configuration#set";
public static class ReportSets
{
@@ -1204,13 +1215,13 @@
"http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/id";
public static String configuration =
- "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/configuration";
+ "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/configuration#set";
public static String inherited =
- "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/inherited";
+ "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/inherited";
public static String reports =
- "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets/reportSet/reports";
+ "http://apache.org/maven/project/profiles#collection/profile/reporting/plugins/plugin/reportSets#collection/reportSet/reports";
}
}
}
@@ -1571,7 +1582,7 @@
"http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/id";
public static String configuration =
- "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/configuration";
+ "http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/configuration#set";
public static String inherited =
"http://apache.org/maven/project/reporting/plugins#collection/plugin/reportSets#collection/reportSet/inherited";
Added: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/DependencyRule.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/DependencyRule.java?rev=739771&view=auto
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/DependencyRule.java (added)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/DependencyRule.java Sun Feb 1 14:59:32 2009
@@ -0,0 +1,19 @@
+package org.apache.maven.project.builder.rules;
+
+import org.apache.maven.shared.model.ModelContainerRule;
+import org.apache.maven.shared.model.ModelProperty;
+
+import java.util.List;
+import java.util.ArrayList;
+
+public class DependencyRule implements ModelContainerRule {
+ public List<ModelProperty> execute(List<ModelProperty> modelProperties) {
+ System.out.println("EXECUTE------------------");
+ List<ModelProperty> properties = new ArrayList<ModelProperty>(modelProperties);
+ List<ModelProperty> goalProperties = new ArrayList<ModelProperty>();
+ List<ModelProperty> processedProperties = new ArrayList<ModelProperty>();
+
+ return processedProperties;
+
+ }
+}
Added: maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/ExecutionRule.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/ExecutionRule.java?rev=739771&view=auto
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/ExecutionRule.java (added)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/main/java/org/apache/maven/project/builder/rules/ExecutionRule.java Sun Feb 1 14:59:32 2009
@@ -0,0 +1,103 @@
+package org.apache.maven.project.builder.rules;
+
+import org.apache.maven.shared.model.*;
+import org.apache.maven.shared.model.impl.DefaultModelDataSource;
+import org.apache.maven.project.builder.ProjectUri;
+import org.apache.maven.project.builder.AlwaysJoinModelContainerFactory;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Arrays;
+
+public class ExecutionRule implements ModelContainerRule {
+
+ public List<ModelProperty> execute(List<ModelProperty> modelProperties) {
+ List<ModelProperty> properties = new ArrayList<ModelProperty>(modelProperties);
+ List<ModelProperty> goalProperties = new ArrayList<ModelProperty>();
+ List<ModelProperty> processedProperties = new ArrayList<ModelProperty>();
+
+ for(ModelProperty mp : properties) {
+ if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.goal)) {
+ goalProperties.add(mp);
+ } else if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI)) {
+ if(!containsProperty(mp, processedProperties)) {
+ processedProperties.add(mp);
+ }
+ } else {
+ processedProperties.add(mp);
+ }
+ }
+
+ //Remove duplicate collections
+ List<ModelProperty> c = new ArrayList<ModelProperty>();
+ boolean x = false;
+ for(ModelProperty mp : processedProperties) {
+ if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.configuration)) {
+ if(x) {
+ c.add(mp);
+ } else {
+ x = true;
+ }
+
+ }
+ }
+
+ processedProperties.removeAll(c);
+
+ if(!goalProperties.isEmpty()) {
+ Collections.reverse(goalProperties);
+ List<ModelProperty> uniqueGoals = new ArrayList<ModelProperty>();
+ for(ModelProperty mp : goalProperties) {
+ if(!containsProperty(mp, uniqueGoals)) {
+ uniqueGoals.add(mp);
+ }
+ }
+ Collections.reverse(uniqueGoals);
+
+ processedProperties.addAll(
+ findIndexOf(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI, processedProperties) + 1,
+ uniqueGoals);
+ }
+
+ List<ModelProperty> emptyTags = new ArrayList<ModelProperty>();
+ for(ModelProperty mp : processedProperties) {
+ if(mp.getUri().equals(ProjectUri.Build.Plugins.Plugin.Executions.Execution.Goals.xURI)
+ && mp.getResolvedValue() != null && mp.getResolvedValue().trim().equals("")) {
+ emptyTags.add(mp);
+ }
+ }
+ processedProperties.removeAll(emptyTags);
+
+ return processedProperties;
+ }
+
+
+ private static int findIndexOf(String uri, List<ModelProperty> modelProperties) {
+ for(ModelProperty mp : modelProperties) {
+ if(mp.getUri().equals(uri)) {
+ return modelProperties.indexOf(mp);
+ }
+ }
+ return -1;
+ }
+
+ private static boolean containsProperty(ModelProperty modelProperty, List<ModelProperty> modelProperties) {
+ for (ModelProperty mp : modelProperties) {
+ if ((mp.getUri().equals(modelProperty.getUri()))) {
+ boolean b = (mp.getResolvedValue() == null && modelProperty.getResolvedValue() == null) ||
+ (mp.getResolvedValue() != null && !mp.getResolvedValue().trim().equals("")
+ && mp.getResolvedValue().equals(modelProperty.getResolvedValue()));
+ /*
+ boolean b = (mp.getResolvedValue() == null && modelProperty.getResolvedValue() == null) ||
+ (mp.getResolvedValue() != null && modelProperty.getResolvedValue() != null
+ && mp.getResolvedValue().equals(modelProperty.getResolvedValue()));
+ */
+ if(b) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/DefaultDomainModel.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/DefaultDomainModel.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/DefaultDomainModelFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/DefaultDomainModelFactory.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java Sun Feb 1 14:59:32 2009
@@ -44,14 +44,13 @@
DomainModel childModel = new DefaultDomainModel(mp2);
DomainModel parentModel = new DefaultDomainModel(mp);
- ModelTransformerContext ctx = new ModelTransformerContext(Arrays.asList(new ArtifactModelContainerFactory(),
- new IdModelContainerFactory()));
+ ModelTransformerContext ctx = new ModelTransformerContext(PomTransformer.MODEL_CONTAINER_INFOS );
ModelTransformer transformer = new PomTransformer(new DefaultDomainModelFactory());
DomainModel domainModel = ctx.transform( Arrays.asList(childModel, parentModel), transformer, transformer );
- DefaultModelDataSource source = new DefaultModelDataSource();
- source.init(domainModel.getModelProperties(), Arrays.asList(new ArtifactModelContainerFactory(), new IdModelContainerFactory()));
+ DefaultModelDataSource source = new DefaultModelDataSource( domainModel.getModelProperties(), PomTransformer.MODEL_CONTAINER_FACTORIES);
+
List<ModelContainer> containers = source.queryFor(ProjectUri.Dependencies.Dependency.xUri);
assertTrue(containers.size() == 2 );
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java Sun Feb 1 14:59:32 2009
@@ -50,15 +50,16 @@
DomainModel parentModel = new DefaultDomainModel(mp);
- ModelTransformerContext ctx = new ModelTransformerContext(Arrays.asList(new ArtifactModelContainerFactory(),
- new IdModelContainerFactory()));
+ ModelTransformerContext ctx = new ModelTransformerContext(PomTransformer.MODEL_CONTAINER_INFOS );
ModelTransformer transformer = new PomTransformer(new DefaultDomainModelFactory());
DomainModel domainModel = ctx.transform( Arrays.asList(parentModel, new DefaultDomainModel(mp0)), transformer, transformer );
- DefaultModelDataSource source = new DefaultModelDataSource();
- source.init(domainModel.getModelProperties(), Arrays.asList(new ArtifactModelContainerFactory(),
- new IdModelContainerFactory(), new PluginExecutionIdModelContainerFactory()));
+
+ List<ModelContainerFactory> factories = new ArrayList<ModelContainerFactory>(PomTransformer.MODEL_CONTAINER_FACTORIES);
+ factories.add(new PluginExecutionIdModelContainerFactory());
+ DefaultModelDataSource source = new DefaultModelDataSource(domainModel.getModelProperties(), factories);
+
List<ModelContainer> containers = source.queryFor(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.xUri);
assertTrue(2 == containers.size());
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/ProfileContextTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/ProfileContextTest.java?rev=739771&r1=739770&r2=739771&view=diff
==============================================================================
--- maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/ProfileContextTest.java (original)
+++ maven/components/branches/MNG-3932/maven-project-builder/src/test/java/org/apache/maven/project/builder/profile/ProfileContextTest.java Sun Feb 1 14:59:32 2009
@@ -1,6 +1,7 @@
package org.apache.maven.project.builder.profile;
import org.apache.maven.project.builder.profile.ProfileContext;
+import org.apache.maven.project.builder.PomTransformer;
import org.apache.maven.project.builder.ProjectUri;
import org.apache.maven.project.builder.ArtifactModelContainerFactory;
import org.apache.maven.project.builder.IdModelContainerFactory;
@@ -29,8 +30,7 @@
modelProperties.add(new ModelProperty(ProjectUri.Profiles.Profile.Activation.Property.name , "foo"));
modelProperties.add(new ModelProperty(ProjectUri.Profiles.Profile.Activation.Property.value , "bar"));
- DefaultModelDataSource dataSource = new DefaultModelDataSource();
- dataSource.init(modelProperties, Arrays.asList(new ArtifactModelContainerFactory(), new IdModelContainerFactory()));
+ DefaultModelDataSource dataSource = new DefaultModelDataSource(modelProperties, PomTransformer.MODEL_CONTAINER_FACTORIES );
List<InterpolatorProperty> interpolatorProperties = new ArrayList<InterpolatorProperty>();
interpolatorProperties.add(new InterpolatorProperty( "${foo}", "bar"));