summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Sanchez <carlos@apache.org>2014-11-24 09:15:00 +0100
committerCarlos Sanchez <carlos@apache.org>2014-11-24 09:15:00 +0100
commitac641f48d97d5765938b1bf5cbb72176b0f42e2f (patch)
treefab80948f96074a4caa82c9db3c5e7d6a216645e
parent54b22367001d20483c85358d7ca0c1eededbc647 (diff)
parentb1838d2e3ce5cc3ac5406b6432192ce0200306af (diff)
downloadarchiva-ac641f48d97d5765938b1bf5cbb72176b0f42e2f.tar.gz
archiva-ac641f48d97d5765938b1bf5cbb72176b0f42e2f.zip
Merge branch 'project-properties'
-rw-r--r--archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java22
-rw-r--r--archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java1
-rw-r--r--archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java3
3 files changed, 26 insertions, 0 deletions
diff --git a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
index 1ff3401fe..967eb0d13 100644
--- a/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
+++ b/archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
@@ -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;
diff --git a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
index 44d294742..a75d007e4 100644
--- a/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
+++ b/archiva-modules/plugins/maven2-repository/src/main/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryStorage.java
@@ -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() );
diff --git a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
index f23e2d62a..3f3b8e2dc 100644
--- a/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
+++ b/archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/storage/maven2/Maven2RepositoryMetadataResolverTest.java
@@ -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