Fix: 3944 - we can just use the existence of the project directory to determine whether it is in the build. This will be a contract of the setProjectDirectory method

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@732683 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Britton Isbell 2009-01-08 11:12:11 +00:00
parent f3c978e962
commit c4782c4a38
2 changed files with 8 additions and 3 deletions

View File

@ -141,6 +141,11 @@ public final class PomClassicDomainModel
this.parentFile = parentFile;
}
/**
* This should only be set for projects that are in the build. Setting for poms in the repo may cause unstable behavior.
*
* @param projectDirectory
*/
public void setProjectDirectory(File projectDirectory)
{
this.projectDirectory = projectDirectory;
@ -153,7 +158,7 @@ public final class PomClassicDomainModel
public boolean isPomInBuild()
{
return projectDirectory != null && new File(projectDirectory, "pom.xml").isFile();
return projectDirectory != null;
}
/**

View File

@ -410,7 +410,7 @@ public class PomConstructionTest
new File( pom.getValue( "properties/siteOut" ).toString() ) );
}
/* FIXME: cf. MNG-3944
/* FIXME: cf. MNG-3944*/
public void testInterpolationOfBasedirInPomWithUnusualName()
throws Exception
{
@ -418,7 +418,7 @@ public class PomConstructionTest
assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop0" ).toString() ) );
assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop1" ).toString() ) );
}
//*/
private PomArtifactResolver artifactResolver( String basedir )
{