diff --git a/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/pom.xml b/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/pom.xml new file mode 100644 index 0000000000..82dd99efbd --- /dev/null +++ b/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/pom.xml @@ -0,0 +1,39 @@ + + + + + + + maven-it-plugins + org.apache.maven.its.plugins + 1-SNAPSHOT + + 4.0.0 + maven-it-plugin-uses-properties + maven-plugin + Maven Integration Test Plugin :: Uses Properties Plugin + 1.0-SNAPSHOT + 2006 + + + org.apache.maven + maven-plugin-api + 2.0 + + + diff --git a/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/src/main/java/org/apache/maven/plugin/coreit/UsesPropertiesMojo.java b/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/src/main/java/org/apache/maven/plugin/coreit/UsesPropertiesMojo.java new file mode 100644 index 0000000000..c98321ab3f --- /dev/null +++ b/its/core-integration-testing-plugins/maven-it-plugin-uses-properties/src/main/java/org/apache/maven/plugin/coreit/UsesPropertiesMojo.java @@ -0,0 +1,43 @@ +package org.apache.maven.plugin.coreit; + +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; + +import java.util.Properties; +import java.io.FileOutputStream; +import java.io.File; + +/** + * Take some configuration values that use interpolated POM values and write them to a properties file + * to make sure they are passing through the system properly. We have reports (MNG-1927) that we're + * + * @goal generate-properties + */ +public class UsesPropertiesMojo + extends AbstractMojo +{ + /** + * @parameter expression=${basedir}" + */ + private File basedir; + + /** + * @parameter expression="${project.properties}" + */ + private Properties properties; + + public void execute() + throws MojoExecutionException + { + try + { + FileOutputStream fos = new FileOutputStream( new File( basedir, "target/project.properties" ) ); + + properties.store( fos, "# Properties generated by the execution of a mojo that uses interpolated POM values for configuration." ); + } + catch( Exception e ) + { + getLog().error( "Error creating mojo generated properties.", e ); + } + } +} diff --git a/its/core-integration-testing-plugins/pom.xml b/its/core-integration-testing-plugins/pom.xml index d4d6947f9c..ee972b184c 100644 --- a/its/core-integration-testing-plugins/pom.xml +++ b/its/core-integration-testing-plugins/pom.xml @@ -20,6 +20,7 @@ maven-it-plugin-packaging maven-it-plugin-parameter-implementation maven-it-plugin-setter - maven-it-plugin-touch + maven-it-plugin-touch + maven-it-plugin-uses-properties