]> source.dussan.org Git - archiva.git/commitdiff
Add pom properties to ProjectVersionMetadata 11/head
authorCarlos Sanchez <carlos@apache.org>
Fri, 21 Nov 2014 19:12:53 +0000 (20:12 +0100)
committerCarlos Sanchez <carlos@apache.org>
Fri, 21 Nov 2014 19:25:26 +0000 (20:25 +0100)
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java

index 1ff3401fe06f727ff0b43c2ce256165406eb5286..967eb0d1326719009395974d0c104daa87739b8f 100644 (file)
@@ -20,8 +20,12 @@ package org.apache.archiva.metadata.model;
  */
 
 import javax.xml.bind.annotation.XmlRootElement;
+
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 
 @XmlRootElement( name = "projectVersionMetadata" )
 public class ProjectVersionMetadata
@@ -52,6 +56,8 @@ public class ProjectVersionMetadata
 
     private List<Dependency> dependencies = new ArrayList<>();
 
+    private Map<String, String> properties = new HashMap<String, String>();
+
     private boolean incomplete;
 
     public String getId()
@@ -184,6 +190,22 @@ public class ProjectVersionMetadata
         this.dependencies.add( dependency );
     }
 
+    public Map<String, String> getProperties()
+    {
+        return properties;
+    }
+
+    public void setProperties( Map<String, String> properties )
+    {
+        this.properties = properties;
+    }
+
+    @SuppressWarnings( { "unchecked", "rawtypes" } )
+    public void setProperties( Properties properties )
+    {
+        setProperties( new HashMap<String, String>((Map) properties ) );
+    }
+
     public boolean isIncomplete()
     {
         return incomplete;
index 44d29474223442391d72b7c2601e0371bdd187de..a75d007e47671b463c6ac04f7c9326670da4253f 100644 (file)
@@ -372,6 +372,7 @@ public class Maven2RepositoryStorage
             metadata.setOrganization( convertOrganization( model.getOrganization() ) );
             metadata.setScm( convertScm( model.getScm() ) );
             metadata.setUrl( model.getUrl() );
+            metadata.setProperties( model.getProperties() );
 
             MavenProjectFacet facet = new MavenProjectFacet();
             facet.setGroupId( model.getGroupId() != null ? model.getGroupId() : model.getParent().getGroupId() );
index f23e2d62a81ba17e92197dfb34f8d4e46cdb57ab..3f3b8e2dc716021a4df9724fe8a13b5f4dab6dca 100644 (file)
@@ -209,6 +209,9 @@ public class Maven2RepositoryMetadataResolverTest
         assertDependency( dependencies.get( 7 ), "junit", "junit", "3.8.1", "test" );
         assertDependency( dependencies.get( 8 ), "easymock", "easymock", "1.2_Java1.3", "test" );
         assertDependency( dependencies.get( 9 ), "easymock", "easymockclassextension", "1.2", "test" );
+
+        assertEquals( 8, metadata.getProperties().size() );
+        assertEquals( "http://www.apache.org/images/asf_logo_wide.gif", metadata.getProperties().get("organization.logo") );
     }
 
     @Test