FELIX-2449: session properties should be given precedence over project properties when filtering

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1140381 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/pom.xml b/bundleplugin/pom.xml
index 5f2d41d..6eaff06 100644
--- a/bundleplugin/pom.xml
+++ b/bundleplugin/pom.xml
@@ -65,12 +65,7 @@
   </dependency>
   <dependency>
    <groupId>org.apache.maven</groupId>
-   <artifactId>maven-plugin-api</artifactId>
-   <version>2.0.7</version>
-  </dependency>
-  <dependency>
-   <groupId>org.apache.maven</groupId>
-   <artifactId>maven-project</artifactId>
+   <artifactId>maven-core</artifactId>
    <version>2.0.7</version>
   </dependency>
   <dependency>
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 d4fd8a6..95a2673 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -46,6 +46,7 @@
 import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.License;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Resource;
@@ -188,6 +189,13 @@
      */
     private MavenArchiveConfiguration archive; // accessed indirectly in JarPluginConfiguration
 
+    /**
+     * @parameter default-value="${session}"
+     * @required
+     * @readonly
+     */
+    private MavenSession m_mavenSession;   
+
     private static final String MAVEN_SYMBOLICNAME = "maven-symbolicname";
     private static final String MAVEN_RESOURCES = "{maven-resources}";
     private static final String LOCAL_PACKAGES = "{local-packages}";
@@ -1012,9 +1020,15 @@
 
         properties.putAll( currentProject.getProperties() );
         properties.putAll( currentProject.getModel().getProperties() );
+        if ( m_mavenSession != null )
+        {
+            properties.putAll( m_mavenSession.getExecutionProperties() );
+        }
+
         properties.putAll( getProperties( currentProject.getModel(), "project.build." ) );
         properties.putAll( getProperties( currentProject.getModel(), "pom." ) );
         properties.putAll( getProperties( currentProject.getModel(), "project." ) );
+
         properties.put( "project.baseDir", baseDir );
         properties.put( "project.build.directory", getBuildDirectory() );
         properties.put( "project.build.outputdirectory", getOutputDirectory() );