Index: src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java
===================================================================
--- src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java	(Revision 632752)
+++ src/test/java/org/apache/maven/plugin/install/InstallMojoTest.java	(Arbeitskopie)
@@ -63,7 +63,7 @@
 
         assertNotNull( mojo );
     }
-
+    
     public void testBasicInstall()
         throws Exception
     {
@@ -90,8 +90,47 @@
             artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + packaging );
 
         assertTrue( installedArtifact.exists() );
+}
+
+    public void testBasicInstallWithFiltering() 
+    	throws Exception
+    {
+	    File testPom = new File( getBasedir(), "target/test-classes/unit/basic-install-test-with-filtering/plugin-config.xml" );
+	
+	    InstallMojo mojo = (InstallMojo) lookupMojo( "install", testPom );
+	
+	    assertNotNull( mojo );
+	
+	    File file = new File( getBasedir(), "target/test-classes/unit/basic-install-test-with-filtering/target/" +
+	        "maven-install-test-1.0-SNAPSHOT.jar" );
+	
+	    artifact = (InstallArtifactStub) getVariableValueFromObject( mojo, "artifact" );
+	
+	    artifact.setFile( file );
+	    
+	    System.setProperty("basedir", "dummy");
+	
+	    mojo.execute();
+	    
+	    System.getProperties().remove("basedir");
+	
+	    String groupId = dotToSlashReplacer( artifact.getGroupId() );
+	
+	    String packaging = getVariableValueFromObject( mojo, "packaging" ).toString();
+	
+	    File installedArtifact = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" +
+	        artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + "." + packaging );
+	
+	    assertTrue( installedArtifact.exists() );
+	    
+	    File installedPom = new File( getBasedir(), LOCAL_REPO + groupId + "/" + artifact.getArtifactId() + "/" +
+	            artifact.getVersion() + "/" + artifact.getArtifactId() + "-" + artifact.getVersion() + ".pom" );
+	    assertTrue( installedPom.exists() );
+	    String content = FileUtils.fileRead(installedPom);
+	    assertFalse(content.contains("${basedir}"));
+    
     }
-
+    
     public void testBasicInstallWithAttachedArtifacts()
         throws Exception
     {
Index: src/test/resources/unit/basic-install-test-with-filtering/plugin-config.xml
===================================================================
--- src/test/resources/unit/basic-install-test-with-filtering/plugin-config.xml	(Revision 0)
+++ src/test/resources/unit/basic-install-test-with-filtering/plugin-config.xml	(Revision 0)
@@ -0,0 +1,35 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-install-plugin</artifactId>
+        <configuration>
+          <pomFile>${basedir}/src/test/resources/unit/basic-install-test/plugin-config.xml</pomFile>
+          <packaging>jar</packaging>
+          <artifact implementation="org.apache.maven.plugin.install.stubs.InstallArtifactStub"/>
+          <attachedArtifacts/>
+          <localRepository>${localRepository}</localRepository>
+			 <filteringEnabled>true</filteringEnabled>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
Index: src/test/resources/unit/basic-install-test-with-filtering/target/maven-install-test-1.0-SNAPSHOT.jar
===================================================================
Kann nicht anzeigen: Dateityp ist als binär angegeben.
svn:mime-type = application/octet-stream

Eigenschaftsänderungen: src/test/resources/unit/basic-install-test-with-filtering/target/maven-install-test-1.0-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Index: src/main/java/org/apache/maven/project/artifact/FilteredProjectArtifactMetadata.java
===================================================================
--- src/main/java/org/apache/maven/project/artifact/FilteredProjectArtifactMetadata.java	(Revision 0)
+++ src/main/java/org/apache/maven/project/artifact/FilteredProjectArtifactMetadata.java	(Revision 0)
@@ -0,0 +1,105 @@
+package org.apache.maven.project.artifact;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Properties;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.metadata.RepositoryMetadataStoreException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.InterpolationFilterReader;
+import org.codehaus.plexus.util.FileUtils.FilterWrapper;
+
+/**
+ * provides filtering of file being copied during install
+ * @author Stefan Armbruster (stefan"at"armbruster-it.de)
+ * @version $Id: $
+ */
+public class FilteredProjectArtifactMetadata extends ProjectArtifactMetadata {
+
+	protected File _file = null; // file is already defined in superclass,
+	// unfortunately as "private"
+	private Properties filterProperties;
+	private MavenProject project;
+	boolean filteringEnabled;
+
+	public FilteredProjectArtifactMetadata(MavenProject project, Artifact artifact, File file, boolean filteringEnabled) {
+		super(artifact, file);
+		this._file = file;
+		this.project = project;
+		this.filteringEnabled = filteringEnabled;
+		initializeFiltering();
+	}
+
+	public FilteredProjectArtifactMetadata(MavenProject project, Artifact artifact, boolean filteringEnabled) {
+		super(artifact);
+		this.project = project;
+		this.filteringEnabled = filteringEnabled;
+		initializeFiltering();
+	}
+
+	/**
+	 * inspired from ResourcesMojo: initializes a composite properties consiting
+	 * of system props and maven project props
+	 */
+	private void initializeFiltering() {
+		if (filteringEnabled) {
+			filterProperties = new Properties();
+
+			// System properties
+			filterProperties.putAll(System.getProperties());
+
+			// Project properties
+			if (project!=null) {
+				filterProperties.putAll(project.getProperties());
+			}
+		}
+	}
+
+	/**
+	 * inspired from ResourcesMojo: in {@link #filteringEnabled} is set,
+	 * properties will be replaced during copying to the local repo
+	 */
+	@Override
+	public void storeInLocalRepository(ArtifactRepository localRepository, ArtifactRepository remoteRepository)
+			throws RepositoryMetadataStoreException {
+		File destination = new File(localRepository.getBasedir(), localRepository.pathOfLocalRepositoryMetadata(this, remoteRepository));
+		FilterWrapper[] wrappers = null;
+		if (filteringEnabled) {
+			wrappers = new FileUtils.FilterWrapper[] {
+				// support ${token}
+				new FileUtils.FilterWrapper() {
+					public Reader getReader(Reader reader) {
+						return new InterpolationFilterReader(reader, filterProperties, "${", "}");
+					}
+				},
+				// support @token@
+				new FileUtils.FilterWrapper() {
+					public Reader getReader(Reader reader) {
+						return new InterpolationFilterReader(reader, filterProperties, "@", "@");
+					}
+				} 
+				/*
+				 * ,
+				 * new FileUtils.FilterWrapper() { public Reader
+				 * getReader(Reader reader) { boolean isPropertiesFile =
+				 * false;
+				 * if (to.isFile() &&
+				 * to.getName().endsWith(".properties")) {
+				 * isPropertiesFile = true; } return new
+				 * InterpolationFilterReader(reader, new
+				 * ReflectionProperties(project, false), "${", "}"); } }
+ 				*/
+			};
+		}
+
+		try {
+			FileUtils.copyFile(_file, destination, null, wrappers);
+		} catch (IOException e) {
+			throw new RepositoryMetadataStoreException("Error copying POM to the local repository.", e);
+		}
+	}
+}
Index: src/main/java/org/apache/maven/plugin/install/InstallMojo.java
===================================================================
--- src/main/java/org/apache/maven/plugin/install/InstallMojo.java	(Revision 632752)
+++ src/main/java/org/apache/maven/plugin/install/InstallMojo.java	(Arbeitskopie)
@@ -19,16 +19,17 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.installer.ArtifactInstallationException;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.artifact.ProjectArtifactMetadata;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.FilteredProjectArtifactMetadata;
 
-import java.io.File;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  * Installs project's main artifact in local repository.
  *
@@ -40,7 +41,22 @@
 public class InstallMojo
     extends AbstractInstallMojo
 {
+	
     /**
+     * reference necessary for property filtering
+     * @parameter default-value="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * if "true", the pom file gets filtered upon copying
+     * @parameter default-value="false"
+     */
+    private boolean filteringEnabled;
+
+    /**
      * @parameter expression="${project.packaging}"
      * @required
      * @readonly
@@ -96,7 +112,7 @@
             }
             else
             {
-                metadata = new ProjectArtifactMetadata( artifact, pomFile );
+                metadata = new FilteredProjectArtifactMetadata( project, artifact, pomFile, filteringEnabled);
                 artifact.addMetadata( metadata );
 
                 File file = artifact.getFile();
Index: pom.xml
===================================================================
--- pom.xml	(Revision 632752)
+++ pom.xml	(Arbeitskopie)
@@ -72,5 +72,10 @@
       <artifactId>plexus-digest</artifactId>
       <version>1.0</version>
     </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>1.4.9</version>
+    </dependency>
   </dependencies>
-</project>
\ Kein Zeilenvorschub am Ende der Datei
+</project>
