Author: cziegeler
Date: Fri Jul 25 04:28:02 2008
New Revision: 679765
URL: http://svn.apache.org/viewvc?rev=679765&view=rev
Log:
FELIX-645 : Add support for global properties.
Modified:
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
Modified:
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
URL:
http://svn.apache.org/viewvc/felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java?rev=679765&r1=679764&r2=679765&view=diff
==============================================================================
---
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
(original)
+++
felix/trunk/scrplugin/src/main/java/org/apache/felix/scrplugin/SCRDescriptorMojo.java
Fri Jul 25 04:28:02 2008
@@ -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