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 e7a9fbf..ab63aea 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -288,7 +288,7 @@
 
             if ( errors.size() > 0 )
             {
-                String failok = properties.getProperty( "-failok" );
+                String failok = builder.getProperty( "-failok" );
                 if ( null == failok || "false".equalsIgnoreCase( failok ) )
                 {
                     jarFile.delete();
@@ -363,48 +363,49 @@
         builder.setClasspath( classpath );
 
         // update BND instructions to add included Maven resources
-        includeMavenResources( currentProject, properties, getLog() );
+        includeMavenResources( currentProject, builder, getLog() );
 
-        if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
+        if ( builder.getProperty( Analyzer.EXPORT_PACKAGE ) == null &&
+             builder.getProperty( Analyzer.PRIVATE_PACKAGE ) == null )
         {
-            if ( properties.containsKey( Analyzer.EXPORT_CONTENTS ) )
+            if ( builder.getProperty( Analyzer.EXPORT_CONTENTS ) != null )
             {
                 /*
                  * if we have exportcontents but no export packages or private packages then we're probably embedding or
                  * inlining one or more jars, so set private package to a non-null (but empty) value to keep Bnd happy.
                  */
-                properties.put( Analyzer.PRIVATE_PACKAGE, "!*" );
+                builder.setProperty( Analyzer.PRIVATE_PACKAGE, "!*" );
             }
             else
             {
-                String bsn = properties.getProperty( Analyzer.BUNDLE_SYMBOLICNAME );
+                String bsn = builder.getProperty( Analyzer.BUNDLE_SYMBOLICNAME );
                 String namespace = bsn.replaceAll( "\\W", "." );
 
-                properties.put( Analyzer.EXPORT_PACKAGE, namespace + ".*" );
+                builder.setProperty( Analyzer.EXPORT_PACKAGE, namespace + ".*" );
             }
         }
 
         // update BND instructions to embed selected Maven dependencies
-        Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, properties );
-        new DependencyEmbedder( embeddableArtifacts ).processHeaders( properties );
+        Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, builder );
+        new DependencyEmbedder( embeddableArtifacts ).processHeaders( builder );
 
         builder.build();
         Jar jar = builder.getJar();
         doMavenMetadata( currentProject, jar );
         builder.setJar( jar );
 
-        String[] removeHeaders = properties.getProperty( Analyzer.REMOVE_HEADERS, "" ).split( "," );
+        String[] removeHeaders = builder.getProperty( Analyzer.REMOVE_HEADERS, "" ).split( "," );
         mergeMavenManifest( currentProject, jar, removeHeaders, getLog() );
 
         return builder;
     }
 
 
-    protected static void includeMavenResources( MavenProject currentProject, Properties properties, Log log )
+    protected static void includeMavenResources( MavenProject currentProject, Analyzer analyzer, Log log )
     {
         // pass maven resource paths onto BND analyzer
         final String mavenResourcePaths = getMavenResourcePaths( currentProject );
-        final String includeResource = ( String ) properties.get( Analyzer.INCLUDE_RESOURCE );
+        final String includeResource = ( String ) analyzer.getProperty( Analyzer.INCLUDE_RESOURCE );
         if ( includeResource != null )
         {
             if ( includeResource.indexOf( MAVEN_RESOURCES ) >= 0 )
@@ -416,18 +417,18 @@
                     String cleanedResource = removeTagFromInstruction( includeResource, MAVEN_RESOURCES );
                     if ( cleanedResource.length() > 0 )
                     {
-                        properties.put( Analyzer.INCLUDE_RESOURCE, cleanedResource );
+                        analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, cleanedResource );
                     }
                     else
                     {
-                        properties.remove( Analyzer.INCLUDE_RESOURCE );
+                        analyzer.unsetProperty( Analyzer.INCLUDE_RESOURCE );
                     }
                 }
                 else
                 {
                     String combinedResource = StringUtils
                         .replace( includeResource, MAVEN_RESOURCES, mavenResourcePaths );
-                    properties.put( Analyzer.INCLUDE_RESOURCE, combinedResource );
+                    analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, combinedResource );
                 }
             }
             else if ( mavenResourcePaths.length() > 0 )
@@ -438,7 +439,7 @@
         }
         else if ( mavenResourcePaths.length() > 0 )
         {
-            properties.put( Analyzer.INCLUDE_RESOURCE, mavenResourcePaths );
+            analyzer.setProperty( Analyzer.INCLUDE_RESOURCE, mavenResourcePaths );
         }
     }
 
@@ -947,9 +948,9 @@
     }
 
 
-    protected static Collection getEmbeddableArtifacts( MavenProject project, Properties properties )
+    protected static Collection getEmbeddableArtifacts( MavenProject project, Analyzer analyzer )
     {
-        String embedTransitive = properties.getProperty( DependencyEmbedder.EMBED_TRANSITIVE );
+        String embedTransitive = analyzer.getProperty( DependencyEmbedder.EMBED_TRANSITIVE );
         if ( Boolean.valueOf( embedTransitive ).booleanValue() )
         {
             // includes transitive dependencies
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
index 6e9cf18..e6307dc 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/DependencyEmbedder.java
@@ -24,7 +24,6 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Properties;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -79,7 +78,7 @@
     }
 
 
-    public void processHeaders( Properties properties ) throws MojoExecutionException
+    public void processHeaders( Analyzer analyzer ) throws MojoExecutionException
     {
         StringBuffer includeResource = new StringBuffer();
         StringBuffer bundleClassPath = new StringBuffer();
@@ -87,12 +86,12 @@
         m_inlinedPaths.clear();
         m_embeddedArtifacts.clear();
 
-        String embedDependencyHeader = properties.getProperty( EMBED_DEPENDENCY );
+        String embedDependencyHeader = analyzer.getProperty( EMBED_DEPENDENCY );
         if ( null != embedDependencyHeader && embedDependencyHeader.length() > 0 )
         {
-            m_embedDirectory = properties.getProperty( EMBED_DIRECTORY );
-            m_embedStripGroup = properties.getProperty( EMBED_STRIP_GROUP, "true" );
-            m_embedStripVersion = properties.getProperty( EMBED_STRIP_VERSION );
+            m_embedDirectory = analyzer.getProperty( EMBED_DIRECTORY );
+            m_embedStripGroup = analyzer.getProperty( EMBED_STRIP_GROUP, "true" );
+            m_embedStripVersion = analyzer.getProperty( EMBED_STRIP_VERSION );
 
             Map embedInstructions = OSGiHeader.parseHeader( embedDependencyHeader );
             processEmbedInstructions( embedInstructions );
@@ -110,14 +109,14 @@
         if ( bundleClassPath.length() > 0 )
         {
             // set explicit default before merging dependency classpath
-            if ( !properties.containsKey( Analyzer.BUNDLE_CLASSPATH ) )
+            if ( analyzer.getProperty( Analyzer.BUNDLE_CLASSPATH ) == null )
             {
-                properties.setProperty( Analyzer.BUNDLE_CLASSPATH, "." );
+                analyzer.setProperty( Analyzer.BUNDLE_CLASSPATH, "." );
             }
         }
 
-        appendDependencies( properties, Analyzer.INCLUDE_RESOURCE, includeResource.toString() );
-        appendDependencies( properties, Analyzer.BUNDLE_CLASSPATH, bundleClassPath.toString() );
+        appendDependencies( analyzer, Analyzer.INCLUDE_RESOURCE, includeResource.toString() );
+        appendDependencies( analyzer, Analyzer.BUNDLE_CLASSPATH, bundleClassPath.toString() );
     }
 
     protected static abstract class DependencyFilter
@@ -417,12 +416,12 @@
     }
 
 
-    private static void appendDependencies( Properties properties, String directiveName, String mavenDependencies )
+    private static void appendDependencies( Analyzer analyzer, String directiveName, String mavenDependencies )
     {
         /*
          * similar algorithm to {maven-resources} but default behaviour here is to append rather than override
          */
-        final String instruction = properties.getProperty( directiveName );
+        final String instruction = analyzer.getProperty( directiveName );
         if ( instruction != null && instruction.length() > 0 )
         {
             if ( instruction.indexOf( MAVEN_DEPENDENCIES ) >= 0 )
@@ -432,12 +431,12 @@
                 if ( mavenDependencies.length() == 0 )
                 {
                     String cleanInstruction = BundlePlugin.removeTagFromInstruction( instruction, MAVEN_DEPENDENCIES );
-                    properties.setProperty( directiveName, cleanInstruction );
+                    analyzer.setProperty( directiveName, cleanInstruction );
                 }
                 else
                 {
                     String mergedInstruction = StringUtils.replace( instruction, MAVEN_DEPENDENCIES, mavenDependencies );
-                    properties.setProperty( directiveName, mergedInstruction );
+                    analyzer.setProperty( directiveName, mergedInstruction );
                 }
             }
             else if ( mavenDependencies.length() > 0 )
@@ -445,20 +444,20 @@
                 if ( Analyzer.INCLUDE_RESOURCE.equalsIgnoreCase( directiveName ) )
                 {
                     // dependencies should be prepended so they can be overwritten by local resources
-                    properties.setProperty( directiveName, mavenDependencies + ',' + instruction );
+                    analyzer.setProperty( directiveName, mavenDependencies + ',' + instruction );
                 }
                 else
                 // Analyzer.BUNDLE_CLASSPATH
                 {
                     // for the classpath we want dependencies to be appended after local entries
-                    properties.setProperty( directiveName, instruction + ',' + mavenDependencies );
+                    analyzer.setProperty( directiveName, instruction + ',' + mavenDependencies );
                 }
             }
             // otherwise leave instruction unchanged
         }
         else if ( mavenDependencies.length() > 0 )
         {
-            properties.setProperty( directiveName, mavenDependencies );
+            analyzer.setProperty( directiveName, mavenDependencies );
         }
         // otherwise leave instruction unchanged
     }
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
index 0f62d6a..ca3cecc 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
@@ -127,7 +127,7 @@
 
         if ( errors.size() > 0 )
         {
-            String failok = properties.getProperty( "-failok" );
+            String failok = analyzer.getProperty( "-failok" );
             if ( null == failok || "false".equalsIgnoreCase( failok ) )
             {
                 throw new MojoFailureException( "Error(s) found in manifest configuration" );
@@ -178,16 +178,17 @@
 
         analyzer.setJar( file );
 
-        if ( !properties.containsKey( Analyzer.EXPORT_PACKAGE ) && !properties.containsKey( Analyzer.EXPORT_CONTENTS )
-            && !properties.containsKey( Analyzer.PRIVATE_PACKAGE ) )
+        if ( analyzer.getProperty( Analyzer.EXPORT_PACKAGE ) == null &&
+             analyzer.getProperty( Analyzer.EXPORT_CONTENTS ) == null &&
+             analyzer.getProperty( Analyzer.PRIVATE_PACKAGE ) == null )
         {
             String export = analyzer.calculateExportsFromContents( analyzer.getJar() );
             analyzer.setProperty( Analyzer.EXPORT_PACKAGE, export );
         }
 
         // Apply Embed-Dependency headers, even though the contents won't be changed
-        Collection embeddableArtifacts = getEmbeddableArtifacts( project, properties );
-        new DependencyEmbedder( embeddableArtifacts ).processHeaders( properties );
+        Collection embeddableArtifacts = getEmbeddableArtifacts( project, analyzer );
+        new DependencyEmbedder( embeddableArtifacts ).processHeaders( analyzer );
 
         analyzer.mergeManifest( analyzer.getJar().getManifest() );
         analyzer.calcManifest();
