maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r721278 - in /maven/components/trunk/maven-project-builder/src: main/java/org/apache/maven/project/builder/ test/java/org/apache/maven/project/builder/
Date Thu, 27 Nov 2008 21:07:58 GMT
Author: sisbell
Date: Thu Nov 27 13:07:57 2008
New Revision: 721278

URL: http://svn.apache.org/viewvc?rev=721278&view=rev
Log:
Some work toward fixing multiple goals for plugin management.

Added:
    maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
Modified:
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
    maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java?rev=721278&r1=721277&r2=721278&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
(original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
Thu Nov 27 13:07:57 2008
@@ -385,8 +385,14 @@
                             public static String phase =
                                 "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/phase";
 
-                            public static String goals =
-                                "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals";
+                            public static class Goals
+                            {
+                                public static String xURI =
+                                    "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection";
+
+                                public static String goal =
+                                    "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
+                            }
 
                             public static String inherited =
                                 "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
@@ -450,8 +456,15 @@
                         }
                     }
 
-                    public static String goals =
-                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals";
+                    public static class Goals
+                    {
+                        public static String xURI =
+                            "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals#collection";
+
+                        public static String goal =
+                            "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/goals#collection/goal";
+
+                    }
 
                     public static String inherited =
                         "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/inherited";
@@ -498,8 +511,14 @@
                         public static String phase =
                             "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/phase";
 
-                        public static String goals =
-                            "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals";
+                        public static class Goals
+                        {
+                            public static String xURI =
+                                "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals#collection";
+
+                            public static String goal =
+                                "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
+                        }
 
                         public static String inherited =
                             "http://apache.org/maven/project/build/plugins#collection/plugin/executions#collection/execution/inherited";
@@ -562,8 +581,14 @@
                             "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/optional";
                     }
                 }
+                public static class Goals
+                {
+                    public static String xURI =
+                        "http://apache.org/maven/project/build/plugins#collection/plugin/goals#collection";
 
-                public static String goals = "http://apache.org/maven/project/build/plugins#collection/plugin/goals";
+                    public static String goal =
+                        "http://apache.org/maven/project/build/plugins#collection/plugin/goals#collection/goal";
+                }
 
                 public static String inherited =
                     "http://apache.org/maven/project/build/plugins#collection/plugin/inherited";
@@ -750,8 +775,14 @@
                                     public static String phase =
                                         "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/phase";
 
-                                    public static String goals =
-                                        "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals";
+                                     public static class Goals
+                                     {
+                                        public static String xURI =
+                                            "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection";
+
+                                        public static String goal =
+                                             "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
+                                     }
 
                                     public static String inherited =
                                         "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/executions#collection/execution/inherited";
@@ -815,8 +846,14 @@
                                 }
                             }
 
-                            public static String goals =
-                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goals";
+                            public static class Goals
+                            {
+                                public static String xURI =
+                                    "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goals#collection";
+
+                                public static String goal =
+                                    "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/goal";
+                            }
 
                             public static String inherited =
                                 "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/inherited";
@@ -865,8 +902,14 @@
                                 public static String phase =
                                     "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/phase";
 
-                                public static String goals =
-                                    "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals";
+                                public static class Goals
+                                {
+                                    public static String xURI =
+                                        "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals#collection";
+
+                                    public static String goal =
+                                        "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/goals#collection/goal";
+                                }
 
                                 public static String inherited =
                                     "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/executions#collection/execution/inherited";
@@ -930,14 +973,20 @@
                             }
                         }
 
-                        public static String goals =
-                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/goals";
+                        public static class Goals
+                        {
+                            public static String xURI =
+                                "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/goals#collection";
+
+                            public static String goal =
+                                "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/goals#collection/goal";
+                        }
 
                         public static String inherited =
-                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins/plugin/inherited";
+                            "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/plugin/configuration";
+                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/configuration";
                     }
                 }
             }

Modified: maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java?rev=721278&r1=721277&r2=721278&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java
(original)
+++ maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/EnforcerPomTest.java
Thu Nov 27 13:07:57 2008
@@ -12,7 +12,7 @@
 
 public class EnforcerPomTest
 {
-    @org.junit.Test
+    @org.junit.Test         
     public void dependencyManagementWithScopeAndClassifier() throws IOException
     {
         List<ModelProperty> mp = new ArrayList<ModelProperty>();

Added: maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java?rev=721278&view=auto
==============================================================================
--- maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
(added)
+++ maven/components/trunk/maven-project-builder/src/test/java/org/apache/maven/project/builder/PluginSpecTest.java
Thu Nov 27 13:07:57 2008
@@ -0,0 +1,73 @@
+package org.apache.maven.project.builder;
+
+import static org.junit.Assert.*;
+import org.apache.maven.shared.model.*;
+import org.apache.maven.shared.model.impl.DefaultModelDataSource;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+public class PluginSpecTest {
+
+    @org.junit.Test
+    public void goalsInherited() {
+        List<ModelProperty> mp = new ArrayList<ModelProperty>();
+        mp.add(new ModelProperty(ProjectUri.xUri, null));
+        mp.add(new ModelProperty(ProjectUri.Build.xUri, null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.xUri, null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.xUri, null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.xUri, null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.groupId,
"gid"));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.artifactId,
"aid"));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.version,
"v1"));
+
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.xUri,
null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.xUri,
null));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.id,
"site-docs"));
+        mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.phase,
"phase"));
+       // mp.add(new ModelProperty(ProjectUri.Build.PluginManagement.Plugins.Plugin.Executions.Execution.goals,
null));
+        /*
+              <phase>pre-site</phase>
+              <goals>
+                <goal>xdoc</goal>
+                <goal>xsd</goal>
+              </goals>
+            </execution>
+            <execution>
+              <id>standard</id>
+              <goals>
+                <goal>java</goal>
+                <goal>xpp3-reader</goal>
+                <goal>xpp3-writer</goal>
+              </goals>
+            </execution>
+
+
+        List<ModelProperty> mp2 = new ArrayList<ModelProperty>();
+        mp2.add(new ModelProperty(ProjectUri.xUri, null));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.xUri, null));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.xUri, null));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.groupId, "gid"));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.artifactId, "aid"));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.xUri, null));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.groupId, "gid"));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.artifactId, "aid"));
+        mp2.add(new ModelProperty(ProjectUri.Dependencies.Dependency.classifier, "tests"));
+
+        DomainModel childModel = new DefaultDomainModel(mp2);
+        DomainModel parentModel = new DefaultDomainModel(mp);
+
+        ModelTransformerContext ctx = new ModelTransformerContext(Arrays.asList(new ArtifactModelContainerFactory(),
+                new IdModelContainerFactory()));
+
+        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()));
+        List<ModelContainer> containers = source.queryFor(ProjectUri.Dependencies.Dependency.xUri);
+        */
+    }
+
+}



Mime
View raw message