mirror of https://github.com/apache/maven.git
o adding IT it0090
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@465864 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
fcb3ef28bf
commit
b1c46ed005
|
@ -0,0 +1,43 @@
|
|||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.maven.it</groupId>
|
||||
<artifactId>maven-core-it0090</artifactId>
|
||||
<description>Test that ensures that envars are interpolated correctly into plugin
|
||||
configurations.</description>
|
||||
<version>1.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<type>jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-core-it-plugin</artifactId>
|
||||
<version>1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<mavenTestEnvar>${env.MAVEN_TEST_ENVAR}</mavenTestEnvar>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>generate-envar-properties</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,2 @@
|
|||
# When we want to test the filtering of envars
|
||||
maven.test.envar=${env.MAVEN_TEST_ENVAR}
|
|
@ -0,0 +1,35 @@
|
|||
package org.apache.maven.it0090;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.Properties;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
||||
public class PomInterpolationTest
|
||||
extends TestCase
|
||||
{
|
||||
private String basedir;
|
||||
|
||||
protected void setUp()
|
||||
throws Exception
|
||||
{
|
||||
basedir = System.getProperty( "basedir" );
|
||||
}
|
||||
|
||||
public void testProjectBuildDirectoryAfterForMojoExecution()
|
||||
throws Exception
|
||||
{
|
||||
Properties testProperties = new Properties();
|
||||
|
||||
File testPropertiesFile = new File( basedir, "target/mojo-generated.properties" );
|
||||
|
||||
assertTrue( testPropertiesFile.exists() );
|
||||
|
||||
testProperties.load( new FileInputStream( testPropertiesFile ) );
|
||||
|
||||
File projectBuildDirectory = new File( basedir, "target" );
|
||||
|
||||
assertEquals( testProperties.getProperty( "maven.test.envar" ), "MAVEN_TEST_ENVAR_VALUE" );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue