diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index b72843e9ea..7acb40fb3f 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -390,6 +390,26 @@ public class PomConstructionTest assertTrue( pom.getValue( "properties/projectSiteOut" ).toString().endsWith( "doc" ) ); } + public void testInterpolationWithBasedirAlignedDirectories() + throws Exception + { + PomTestWrapper pom = buildPom( "basedir-aligned-interpolation" ); + assertEquals( new File( pom.getBasedir(), "src/main/java" ), + new File( pom.getValue( "properties/buildMainSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "src/test/java" ), + new File( pom.getValue( "properties/buildTestSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "src/main/scripts" ), + new File( pom.getValue( "properties/buildScriptSrc" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target" ), + new File( pom.getValue( "properties/buildOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/classes" ), + new File( pom.getValue( "properties/buildMainOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/test-classes" ), + new File( pom.getValue( "properties/buildTestOut" ).toString() ) ); + assertEquals( new File( pom.getBasedir(), "target/site" ), + new File( pom.getValue( "properties/siteOut" ).toString() ) ); + } + private PomArtifactResolver artifactResolver( String basedir ) { return new FileBasedPomArtifactResolver( new File( BASE_POM_DIR, basedir ) ); diff --git a/maven-project/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml b/maven-project/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml new file mode 100644 index 0000000000..e9fcd5ba57 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/basedir-aligned-interpolation/pom.xml @@ -0,0 +1,60 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3822 + test1 + 1.0-SNAPSHOT + + Maven Integration Test :: MNG-3822 + + Verify that POM interpolation uses basedir-aligned build directories. + + + + + ${project.build.sourceDirectory} + ${project.build.testSourceDirectory} + ${project.build.scriptSourceDirectory} + ${project.build.directory} + ${project.build.outputDirectory} + ${project.build.testOutputDirectory} + ${project.reporting.outputDirectory} + + + + + src/main/java + src/test/java + src/main/scripts + target + target/classes + target/test-classes + + + + target/site + +