Index: src/test/java/org/apache/maven/plugins/help/EffectivePropertiesMojoTest.java
===================================================================
--- src/test/java/org/apache/maven/plugins/help/EffectivePropertiesMojoTest.java	(revision 0)
+++ src/test/java/org/apache/maven/plugins/help/EffectivePropertiesMojoTest.java	(revision 0)
@@ -0,0 +1,45 @@
+package org.apache.maven.plugins.help;
+
+import org.apache.maven.plugin.testing.AbstractMojoTestCase;
+
+import java.io.File;
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ *
+ *
+ **/
+public class EffectivePropertiesMojoTest extends AbstractMojoTestCase
+{
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+    }
+
+    public void testMojoGoal() throws Exception
+    {
+        File testPom = new File( getBasedir(),
+          "src/test/resources/effective-properties-test-pom.xml" );
+        assertTrue( testPom.getAbsolutePath() + " does not exist", testPom.exists() );
+        EffectivePropertiesMojo mojo = (EffectivePropertiesMojo) lookupMojo( "help:effective-properties", testPom);
+        assertTrue( "mojo is null and it shouldn't be", mojo != null );
+
+    }
+}

Property changes on: src/test/java/org/apache/maven/plugins/help/EffectivePropertiesMojoTest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/test/resources/effective-properties-test-pom.xml
===================================================================
--- src/test/resources/effective-properties-test-pom.xml	(revision 0)
+++ src/test/resources/effective-properties-test-pom.xml	(revision 0)
@@ -0,0 +1,70 @@
+<project xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd' xmlns='http://maven.apache.org/POM/4.0.0'>
+  
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>foo</artifactId>
+  <packaging>jar</packaging>
+  <name>Maven Test</name>
+  <version>0.0.1-SNAPSHOT</version>
+  <description>
+    Test POM for effective properties
+  </description>
+  <inceptionYear>2001</inceptionYear>
+  <prerequisites>
+    <maven>2.0</maven>
+  </prerequisites>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-settings</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-tools-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-descriptor</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-dependency-tree</artifactId>
+      <version>1.0-alpha-2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-plugin-testing-harness</artifactId>
+      <version>1.0-beta-1</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+            </testResource>
+        </testResources>
+        <plugins>
+          
+        </plugins>
+    </build>
+  
+  <properties>
+        <propertyA>A</propertyA>
+    </properties>
+</project>
+

Property changes on: src/test/resources/effective-properties-test-pom.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/main/java/org/apache/maven/plugins/help/EffectivePropertiesMojo.java
===================================================================
--- src/main/java/org/apache/maven/plugins/help/EffectivePropertiesMojo.java	(revision 0)
+++ src/main/java/org/apache/maven/plugins/help/EffectivePropertiesMojo.java	(revision 0)
@@ -0,0 +1,205 @@
+package org.apache.maven.plugins.help;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.model.Profile;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+/**
+ * Copyright 2005 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+/**
+ * Print out the properties that are loaded in Maven.  Including: System.getProperties, POM properties and the properties of all active
+ * profiles.  Also prints out the contents of any filters in use.
+ *
+ *
+ * @goal effective-properties
+ */
+public class EffectivePropertiesMojo
+    extends AbstractMojo
+{
+    /**
+     * The Maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+
+
+
+    /**
+     * The newline string to use when serialising the dependency tree.
+     */
+    private static final String NEWLINE = System.getProperty( "line.separator" );
+
+    /**
+     * If specified, this parameter will cause the properties to be written to the path specified,
+     * instead of
+     * writing to the console.
+     *
+     * @parameter expression="${output}"
+     */
+    private File output;
+
+    /**
+     * Print out:<br/>
+     * System.getProperties()<br/>
+     * MavenProject.getProperties()<br/>
+     * MavenProject.getModel().getBuild.getFilters() contents<br/>
+     * MavenProject.getActiveProfiles()[i].getProperties()<br/>
+     *
+     * @throws MojoExecutionException
+     * @throws MojoFailureException
+     */
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
+    {
+        StringBuffer result = new StringBuffer( 512 );
+        Properties systemProps = System.getProperties();
+        result.append( "System Properties:" ).append( NEWLINE );
+        appendProperties( systemProps, result );
+        result.append( NEWLINE )
+            .append( "---------------------" ).append( NEWLINE )
+            .append( "POM Properties:" ).append( NEWLINE );
+        Properties mvnProps = project.getProperties();
+        appendProperties( mvnProps, result );
+        result.append( NEWLINE );
+        List filters = project.getModel().getBuild().getFilters();
+        result.append( NEWLINE )
+            .append( "---------------------" ).append( NEWLINE )
+            .append( "Filters:" ).append( NEWLINE );
+        for ( Iterator iterator = filters.iterator(); iterator.hasNext(); )
+        {
+            String filter = (String) iterator.next();
+
+            try
+            {
+                processFilter( filter, result );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "Failed to read in filter: " + filter, e );
+            }
+        }
+        List profiles = project.getActiveProfiles();
+        result.append("----------------").append("Profiles:").append(NEWLINE);
+        if (profiles.isEmpty() == false)
+        {
+            for ( Iterator iterator = profiles.iterator(); iterator.hasNext(); )
+            {
+                Profile profile = (Profile) iterator.next();
+                //result.append(profile).append(NEWLINE);
+                result.append("Profile: ").append(profile.getId()).append(NEWLINE);
+                Properties profProps = profile.getProperties();
+                appendProperties( profProps, result);
+                result.append(NEWLINE);
+            }
+        }
+        else
+        {
+            result.append( "There are no active profiles." );
+        }
+        if ( output != null )
+        {
+            output.getParentFile().mkdirs();
+
+            FileWriter writer = null;
+
+            try
+            {
+                writer = new FileWriter( output );
+
+                writer.write( result.toString() );
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException( "Cannot print properties", e );
+            }
+            finally
+            {
+                if ( writer != null )
+                {
+                    try
+                    {
+                        writer.close();
+                    }
+                    catch ( IOException exception )
+                    {
+                        getLog().error( "Cannot close file", exception );
+                    }
+                }
+            }
+
+        }
+        else
+        {
+            getLog().info( result );
+        }
+        appendProperties( mvnProps, result );
+    }
+
+    /**
+     * Handle the filters
+     * @param filter
+     * @param result
+     * @throws IOException
+     */
+    private void processFilter( String filter, StringBuffer result )
+        throws IOException
+    {
+
+        BufferedReader reader = new BufferedReader( new FileReader( filter ) );
+        String line = null;
+        result.append( "Filter: " ).append( filter ).append( NEWLINE ).append( "Values: " ).append( NEWLINE );
+        while ( ( line = reader.readLine() ) != null )
+        {
+            if ( line.startsWith( "#" ) == false )
+            {
+                result.append( line ).append( NEWLINE );
+            }
+        }
+        result.append( NEWLINE );
+
+    }
+
+    /**
+     * Append the properties to the StringBuffer
+     * @param properties
+     * @param result
+     */
+    private void appendProperties( Properties properties, StringBuffer result )
+    {
+        for ( Iterator iterator = properties.entrySet().iterator(); iterator.hasNext(); )
+        {
+            Map.Entry entry = (Map.Entry) iterator.next();
+            result.append( entry.getKey().toString() ).append( '=' ).append( entry.getValue() ).append( NEWLINE );
+        }
+    }
+}

Property changes on: src/main/java/org/apache/maven/plugins/help/EffectivePropertiesMojo.java
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/site/apt/usage.apt
===================================================================
--- src/site/apt/usage.apt	(revision 538629)
+++ src/site/apt/usage.apt	(working copy)
@@ -88,4 +88,16 @@
 mvn help:effective-settings -Doutput=/path/to/file
 +-----+
 
+* The <<<help:effective-properties>>> Mojo
 
+    Prints out the current System and maven properties (Filters, POM and Active Profiles) either to a file or to the console.
+
+    Optionally, the <<<output>>> parameter can be specified to divert this output to a file
+
+    The mojo can be executed using the following command:
+    
++-----+
+mvn help:effective-properties -Doutput=/path/to/file
++-----+
+
+
Index: src/site/apt/index.apt
===================================================================
--- src/site/apt/index.apt	(revision 538629)
+++ src/site/apt/index.apt	(working copy)
@@ -30,6 +30,8 @@
   * {{{effective-settings-mojo.html}help:effective-settings}} prints out the calculated settings for the project, given any
     profile enhancement and the inheritance of the global settings into the user-level settings.
 
+  * {{{effective-properties-mojo.html}help:effective-properties}} prints out active System and user defined properties.
+
 * Usage
 
    Instructions on how to use the Help Plugin can be found {{{usage.html}here}}.
Index: pom.xml
===================================================================
--- pom.xml	(revision 538629)
+++ pom.xml	(working copy)
@@ -54,7 +54,34 @@
       <artifactId>maven-dependency-tree</artifactId>
       <version>1.0-alpha-2</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-plugin-testing-harness</artifactId>
+      <version>1.0-beta-1</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
+  <build>
+        <sourceDirectory>src/main/java</sourceDirectory>
+        <testSourceDirectory>src/test/java</testSourceDirectory>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <forkMode>once</forkMode>
+                    <useFile>true</useFile>
+                    <includes>
+                        <include>**/*Test.java</include>
+                    </includes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
   <reporting>
     <plugins>
       <plugin>

