FELIX-645 : Add support for global properties.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@679765 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
index 65b53bb..46cb241 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
@@ -87,6 +87,13 @@
private String sourceExcludes;
/**
+ * Predefined properties.
+ *
+ * @parameter
+ */
+ private Map properties = new HashMap();
+
+ /**
* @see org.apache.maven.plugin.AbstractMojo#execute()
*/
public void execute() throws MojoExecutionException, MojoFailureException {
@@ -245,6 +252,18 @@
// Utility handler for propertie
final PropertyHandler propertyHandler = new PropertyHandler(component, ocd);
+ // pre configured properties
+ final Iterator globalPropIter = this.properties.entrySet().iterator();
+ while ( globalPropIter.hasNext() ) {
+ final Map.Entry entry = (Map.Entry)globalPropIter.next();
+ final Property p = new Property();
+ p.setName(entry.getKey().toString());
+ p.setValue(entry.getValue().toString());
+ p.setType("String");
+ p.setPrivate(true);
+ component.addProperty(p);
+ }
+
JavaClassDescription currentDescription = description;
do {
// properties