Additional debug to help with problem determination

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@723704 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 ab63aea..dc49af2 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -29,6 +29,7 @@
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
@@ -389,18 +390,57 @@
         Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, builder );
         new DependencyEmbedder( embeddableArtifacts ).processHeaders( builder );
 
+        dumpInstructions( "BND Instructions:", builder.getProperties(), getLog() );
+
         builder.build();
         Jar jar = builder.getJar();
-        doMavenMetadata( currentProject, jar );
-        builder.setJar( jar );
+
+        dumpManifest( "BND Manifest:", jar.getManifest(), getLog() );
 
         String[] removeHeaders = builder.getProperty( Analyzer.REMOVE_HEADERS, "" ).split( "," );
+
+        doMavenMetadata( currentProject, jar );
         mergeMavenManifest( currentProject, jar, removeHeaders, getLog() );
+        builder.setJar( jar );
+
+        dumpManifest( "Final Manifest:", jar.getManifest(), getLog() );
 
         return builder;
     }
 
 
+    protected static void dumpInstructions( String title, Properties properties, Log log )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( title );
+            log.debug( "------------------------------------------------------------------------" );
+            for ( Enumeration e = properties.propertyNames(); e.hasMoreElements(); )
+            {
+                String key = (String) e.nextElement();
+                log.debug( key + ": " + properties.getProperty( key ) );
+            }
+            log.debug( "------------------------------------------------------------------------" );
+        }
+    }
+
+
+    protected static void dumpManifest( String title, Manifest manifest, Log log )
+    {
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( title );
+            log.debug( "------------------------------------------------------------------------" );
+            for ( Iterator i = manifest.getMainAttributes().entrySet().iterator(); i.hasNext(); )
+            {
+                Map.Entry entry = (Map.Entry) i.next();
+                log.debug( entry.getKey() + ": " + entry.getValue() );
+            }
+            log.debug( "------------------------------------------------------------------------" );
+        }
+    }
+
+
     protected static void includeMavenResources( MavenProject currentProject, Analyzer analyzer, Log log )
     {
         // pass maven resource paths onto BND analyzer