Author: struberg
Date: Mon Apr 30 20:58:28 2012
New Revision: 1332385

URL: http://svn.apache.org/viewvc?rev=1332385&view=rev
Log:
MRELEASE-727 only parse for the pom directory if the SCM itself doesn't know

If the SCM can provide a relativePath then we take this info. 
Otherwise we scan all subdirs until we found the pom in question.

This is needed since certain SCMs cannot provide the relative info
as they don't have the concept of a 'sparse' checkout.

Modified:
    
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java

Modified: 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java?rev=1332385&r1=1332384&r2=1332385&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
 (original)
+++ 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RunPerformGoalsPhase.java
 Mon Apr 30 20:58:28 2012
@@ -88,7 +88,12 @@ public class RunPerformGoalsPhase
 
         File pomFile = new File( workDir, pomFileName );
         PomFinder pomFinder = new PomFinder( getLogger() );
-        boolean foundPom = pomFinder.parsePom( pomFile );
+        boolean foundPom = false;
+
+        if ( StringUtils.isEmpty( 
releaseDescriptor.getScmRelativePathProjectDirectory() ) )
+        {
+            foundPom = pomFinder.parsePom( pomFile );
+        }
 
         File workDirectory;
         if ( simulate )
@@ -106,9 +111,11 @@ public class RunPerformGoalsPhase
             if ( matchingPom != null )
             {
                 getLogger().info( "Invoking perform goals in directory " + 
matchingPom.getParent() );
-                // the directory of the POM in a flat project layout is not
+                // The directory of the POM in a flat project layout is not
                 // the same directory as the SCM checkout directory!
-                // releaseDescriptor.setCheckoutDirectory( 
matchingPom.getParent() );
+                // The same is true for a sparse checkout in e.g. GIT
+                // the project to build could be in target/checkout/some/dir/
+                workDirectory = matchingPom.getParentFile();
             }
         }
 


Reply via email to