maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r710203 - in /maven/components/branches/sisbell-maven-3.0-mercury: maven-mercury/src/main/java/org/apache/maven/mercury/ maven-mercury/src/test/java/org/apache/maven/mercury/ maven-mercury/src/test/resources/ maven-project-builder/src/main/...
Date Mon, 03 Nov 2008 22:46:37 GMT
Author: sisbell
Date: Mon Nov  3 14:46:37 2008
New Revision: 710203

URL: http://svn.apache.org/viewvc?rev=710203&view=rev
Log:
Correct support for exclusions. Needed to create a new model container for exclusions.

Added:
    maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java
Modified:
    maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDomainModel.java
    maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/java/org/apache/maven/mercury/MavenDependencyProcessorTest.java
    maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/resources/simpleWithExclusions.xml
    maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java

Modified: maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDomainModel.java
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDomainModel.java?rev=710203&r1=710202&r2=710203&view=diff
==============================================================================
--- maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDomainModel.java
(original)
+++ maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/main/java/org/apache/maven/mercury/MavenDomainModel.java
Mon Nov  3 14:46:37 2008
@@ -24,6 +24,7 @@
 import org.apache.maven.project.builder.ProjectUri;
 import org.apache.maven.project.builder.ArtifactModelContainerFactory;
 import org.apache.maven.project.builder.IdModelContainerFactory;
+import org.apache.maven.project.builder.ExclusionModelContainerFactory;
 import org.apache.maven.project.builder.profile.ProfileContext;
 import org.apache.maven.mercury.artifact.ArtifactBasicMetadata;
 
@@ -196,9 +197,9 @@
         if(metadata.getScope() == null) {
             metadata.setScope("runtime");
         }
-        /*
+
         ModelDataSource dataSource = new DefaultModelDataSource();
-        dataSource.init(container.getProperties(), Arrays.asList(new ArtifactModelContainerFactory(),
new IdModelContainerFactory()) );
+        dataSource.init(container.getProperties(), Arrays.asList(new ArtifactModelContainerFactory(),
new ExclusionModelContainerFactory()) );
         List<ArtifactBasicMetadata> exclusions = new ArrayList<ArtifactBasicMetadata>();
 
         for(ModelContainer exclusion : dataSource.queryFor(ProjectUri.Dependencies.Dependency.Exclusions.Exclusion.xUri))
{
@@ -215,7 +216,7 @@
 
         }
         metadata.setExclusions(exclusions);
-        */
+        
         return metadata;
     }
 }

Modified: maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/java/org/apache/maven/mercury/MavenDependencyProcessorTest.java
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/java/org/apache/maven/mercury/MavenDependencyProcessorTest.java?rev=710203&r1=710202&r2=710203&view=diff
==============================================================================
--- maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/java/org/apache/maven/mercury/MavenDependencyProcessorTest.java
(original)
+++ maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/java/org/apache/maven/mercury/MavenDependencyProcessorTest.java
Mon Nov  3 14:46:37 2008
@@ -38,11 +38,11 @@
         assertEquals("Dependencies incorrect", 2, dependencies.size());
 
     }
-    /*
+
     @org.junit.Test
     public void testSimplePomWithExclusions() throws MetadataReaderException {
         Stack<File> files = new Stack<File>();
-        files.add(new File("src/test/resources/simpleWithExclusions.xml"));
+        files.add(new File(basedir, "src/test/resources/simpleWithExclusions.xml"));
 
         MavenDependencyProcessor processor = new MavenDependencyProcessor();
         List<ArtifactBasicMetadata> dependencies = processor.getDependencies(new ArtifactBasicMetadata(),
@@ -53,7 +53,7 @@
         assertEquals("Exclusions incorrect", 2, dependency.getExclusions().size());
 
     }
-   */
+
     @org.junit.Test
     public void testSinglePomWithProfile() throws MetadataReaderException {
         Stack<File> files = new Stack<File>();

Modified: maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/resources/simpleWithExclusions.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/resources/simpleWithExclusions.xml?rev=710203&r1=710202&r2=710203&view=diff
==============================================================================
--- maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/resources/simpleWithExclusions.xml
(original)
+++ maven/components/branches/sisbell-maven-3.0-mercury/maven-mercury/src/test/resources/simpleWithExclusions.xml
Mon Nov  3 14:46:37 2008
@@ -1,11 +1,6 @@
 
 <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>x-parent-aid</artifactId>
-    <groupId>x-parent-gid</groupId>
-    <version>1.0</version>
-  </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>c-aid</artifactId>
   <dependencies>

Added: maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java?rev=710203&view=auto
==============================================================================
--- maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java
(added)
+++ maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ExclusionModelContainerFactory.java
Mon Nov  3 14:46:37 2008
@@ -0,0 +1,61 @@
+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 ExclusionModelContainerFactory     implements ModelContainerFactory
+{
+
+    private static final Collection<String> uris = Collections.unmodifiableList( Arrays.asList(
+
+        ProjectUri.Dependencies.Dependency.Exclusions.Exclusion.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 ExclusionModelContainer( modelProperties );
+    }
+
+    private static class ExclusionModelContainer
+        implements ModelContainer
+    {
+
+        public ExclusionModelContainer(List<ModelProperty> properties) {
+            this.properties = properties;
+        }
+
+        private List<ModelProperty> properties;
+
+
+        public ModelContainerAction containerAction( ModelContainer modelContainer )
+        {
+            throw new UnsupportedOperationException();
+        }
+
+        public ModelContainer createNewInstance( List<ModelProperty> modelProperties
)
+        {
+            return new ExclusionModelContainer( modelProperties );
+        }
+
+        public List<ModelProperty> getProperties()
+        {
+            return properties;
+        }
+
+    }
+}
+

Modified: maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
URL: http://svn.apache.org/viewvc/maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java?rev=710203&r1=710202&r2=710203&view=diff
==============================================================================
--- maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
(original)
+++ maven/components/branches/sisbell-maven-3.0-mercury/maven-project-builder/src/main/java/org/apache/maven/project/builder/ProjectUri.java
Mon Nov  3 14:46:37 2008
@@ -430,18 +430,18 @@
                             public static class Exclusions
                             {
                                 public static String xUri =
-                                    "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions";
+                                    "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions#collection";
 
                                 public static class Exclusion
                                 {
                                     public static String xUri =
-                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion";
+                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions#collection/exclusion";
 
                                     public static String artifactId =
-                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion/artifactId";
+                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions#collection/exclusion/artifactId";
 
                                     public static String groupId =
-                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions/exclusion/groupId";
+                                        "http://apache.org/maven/project/build/pluginManagement/plugins#collection/plugin/dependencies/dependency/exclusions#collection/exclusion/groupId";
                                 }
                             }
 
@@ -543,18 +543,18 @@
                         public static class Exclusions
                         {
                             public static String xUri =
-                                "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions";
+                                "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection";
 
                             public static class Exclusion
                             {
                                 public static String xUri =
-                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion";
+                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion";
 
                                 public static String artifactId =
-                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/artifactId";
+                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
 
                                 public static String groupId =
-                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/groupId";
+                                    "http://apache.org/maven/project/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
                             }
                         }
 
@@ -795,18 +795,18 @@
                                     public static class Exclusions
                                     {
                                         public static String xUri =
-                                            "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions";
+                                            "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection";
 
                                         public static class Exclusion
                                         {
                                             public static String xUri =
-                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion";
+                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion";
 
                                             public static String artifactId =
-                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/artifactId";
+                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
 
                                             public static String groupId =
-                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions/exclusion/groupId";
+                                                "http://apache.org/maven/project/profiles#collection/profile/build/pluginManagement/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
                                         }
                                     }
 
@@ -910,18 +910,18 @@
                                 public static class Exclusions
                                 {
                                     public static String xUri =
-                                        "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection";
+                                        "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection#collection";
 
                                     public static class Exclusion
                                     {
                                         public static String xUri =
-                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion";
+                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection#collection/exclusion";
 
                                         public static String artifactId =
-                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
+                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection#collection/exclusion/artifactId";
 
                                         public static String groupId =
-                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
+                                            "http://apache.org/maven/project/profiles#collection/profile/build/plugins#collection/plugin/dependencies#collection/dependency/exclusions#collection#collection/exclusion/groupId";
                                     }
                                 }
 
@@ -1084,18 +1084,18 @@
                     public static class Exclusions
                     {
                         public static String xUri =
-                            "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection";
+                            "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection#collection";
 
                         public static class Exclusion
                         {
                             public static String xUri =
-                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection/exclusion";
+                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection#collection/exclusion";
 
                             public static String artifactId =
-                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
+                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection#collection/exclusion/artifactId";
 
                             public static String groupId =
-                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
+                                "http://apache.org/maven/project/profiles#collection/profile/dependencies#collection/dependency/exclusions#collection#collection/exclusion/groupId";
                         }
                     }
 
@@ -1207,18 +1207,18 @@
                         public static class Exclusions
                         {
                             public static String xUri =
-                                "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection";
+                                "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection#collection";
 
                             public static class Exclusion
                             {
                                 public static String xUri =
-                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion";
+                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection#collection/exclusion";
 
                                 public static String artifactId =
-                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
+                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection#collection/exclusion/artifactId";
 
                                 public static String groupId =
-                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
+                                    "http://apache.org/maven/project/profiles#collection/profile/dependencyManagement/dependencies#collection/dependency/exclusions#collection#collection/exclusion/groupId";
                             }
                         }
 
@@ -1455,18 +1455,18 @@
             public static class Exclusions
             {
                 public static String xUri =
-                    "http://apache.org/maven/project/dependencies#collection/dependency/exclusions";
+                    "http://apache.org/maven/project/dependencies#collection/dependency/exclusions#collection";
 
                 public static class Exclusion
                 {
                     public static String xUri =
-                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion";
+                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions#collection/exclusion";
 
                     public static String artifactId =
-                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion/artifactId";
+                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
 
                     public static String groupId =
-                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions/exclusion/groupId";
+                        "http://apache.org/maven/project/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
                 }
             }
 
@@ -1572,18 +1572,18 @@
                 public static class Exclusions
                 {
                     public static String xUri =
-                        "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions";
+                        "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions#collection";
 
                     public static class Exclusion
                     {
                         public static String xUri =
-                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion";
+                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion";
 
                         public static String artifactId =
-                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/artifactId";
+                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion/artifactId";
 
                         public static String groupId =
-                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions/exclusion/groupId";
+                            "http://apache.org/maven/project/dependencyManagement/dependencies#collection/dependency/exclusions#collection/exclusion/groupId";
                     }
                 }
 



Mime
View raw message