FELIX-3347: when adding the Maven session environment to the properties passed to bnd, avoid entries whose keys start with upper-case letter (since they end up in the final manifest)
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1243069 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index f16a518..083142d 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -1183,7 +1183,23 @@
properties.putAll( currentProject.getModel().getProperties() );
if ( m_mavenSession != null )
{
- properties.putAll( m_mavenSession.getExecutionProperties() );
+ try
+ {
+ Properties sessionProperties = m_mavenSession.getExecutionProperties();
+ for ( Enumeration e = sessionProperties.propertyNames(); e.hasMoreElements(); )
+ {
+ // don't pass upper-case settings to bnd
+ String key = ( String ) e.nextElement();
+ if ( key.length() > 0 && !Character.isUpperCase( key.charAt( 0 ) ) )
+ {
+ properties.put( key, sessionProperties.getProperty( key ) );
+ }
+ }
+ }
+ catch ( Exception e )
+ {
+ getLog().warn( "Problem with Maven session properties: " + e.getLocalizedMessage() );
+ }
}
properties.putAll( getProperties( currentProject.getModel(), "project.build." ) );