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 67f9163..258b7c0 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -25,6 +25,7 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.lang.reflect.Array;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -419,7 +420,7 @@
 
         Builder builder = new Builder();
         builder.setBase( getBase( currentProject ) );
-        builder.setProperties( properties );
+        builder.setProperties( sanitize( properties ) );
         if ( classpath != null )
         {
             builder.setClasspath( classpath );
@@ -429,6 +430,67 @@
     }
 
 
+    protected static Properties sanitize( Properties properties )
+    {
+        // convert any non-String keys/values to Strings
+        Properties sanitizedEntries = new Properties();
+        for ( Iterator itr = properties.entrySet().iterator(); itr.hasNext(); )
+        {
+            Map.Entry entry = ( Map.Entry ) itr.next();
+            if ( entry.getKey() instanceof String == false )
+            {
+                String key = sanitize( entry.getKey() );
+                if ( !properties.containsKey( key ) )
+                {
+                    sanitizedEntries.setProperty( key, sanitize( entry.getValue() ) );
+                }
+                itr.remove();
+            }
+            else if ( entry.getValue() instanceof String == false )
+            {
+                entry.setValue( sanitize( entry.getValue() ) );
+            }
+        }
+        properties.putAll( sanitizedEntries );
+        return properties;
+    }
+
+
+    protected static String sanitize( Object value )
+    {
+        if ( value instanceof String )
+        {
+            return ( String ) value;
+        }
+        else if ( value instanceof Iterable )
+        {
+            String delim = "";
+            StringBuilder buf = new StringBuilder();
+            for ( Object i : ( Iterable<?> ) value )
+            {
+                buf.append( delim ).append( i );
+                delim = ", ";
+            }
+            return buf.toString();
+        }
+        else if ( value.getClass().isArray() )
+        {
+            String delim = "";
+            StringBuilder buf = new StringBuilder();
+            for ( int i = 0, len = Array.getLength( value ); i < len; i++ )
+            {
+                buf.append( delim ).append( Array.get( value, i ) );
+                delim = ", ";
+            }
+            return buf.toString();
+        }
+        else
+        {
+            return String.valueOf( value );
+        }
+    }
+
+
     protected void addMavenInstructions( MavenProject currentProject, Builder builder ) throws Exception
     {
         if ( currentProject.getBasedir() != null )
diff --git a/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java b/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
index e224c96..44c7f97 100644
--- a/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
+++ b/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
@@ -21,6 +21,8 @@
  */
 
 import java.io.File;
+import java.io.FileOutputStream;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedHashSet;
 import java.util.Map;
@@ -371,4 +373,25 @@
         String eas2 = manifest2.getMainAttributes().getValue( "Embedded-Artifacts" );
         assertEquals( eas1, eas2 );
     }
+
+
+    public void testPropertySanitizing() throws Exception
+    {
+        MavenProject project = getMavenProjectStub();
+
+        Properties props = new Properties();
+
+        props.put( new File( "A" ), new File( "B" ) );
+        props.put( new int[4], new HashMap( 2 ) );
+        props.put( Arrays.asList( 1, "two", 3.0 ), new float[5] );
+
+        props.put( "A", new File( "B" ) );
+        props.put( "4", new HashMap( 2 ) );
+        props.put( "1, two, 3.0", new char[5] );
+
+        Builder builder = plugin.getOSGiBuilder( project, new HashMap(), props, plugin.getClasspath( project ) );
+
+        File file = new File( getBasedir(), "target" + File.separatorChar + "test.props" );
+        builder.getProperties().store( new FileOutputStream( file ), "TEST" );
+    }
 }
