diff --git a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java index 8265c11ed7..4b32ea430c 100644 --- a/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java +++ b/maven-project/src/main/java/org/apache/maven/project/builder/PomClassicDomainModel.java @@ -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; } /** 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 0b1a1e0d92..03a7c4c942 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 @@ -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 ) {