Details
Description
Was failing with a nullpointer exception. I downloaded the source and added some println statements to ReleaseUtil.java (in mvn-release-manager), so it's easy enough to see:
First I added:
public static String getCommonBasedir( List reactorProjects, char separator )
{
System.out.println("ReleaseUtil#getCommonBaseDir()");
...
and in the main loop of this same method I added:
// added:start
System.out.println(" - dir : " + dir );
// added:end
if ( basedir == null )
{ basedir = dir; } else
...
Also, I added:
public static int getBaseWorkingDirectoryParentCount( String basedir, String workingDirectory )
{
System.out.println("getBaseWorkingDirectoryParentCount()");
System.out.println(" ** basedir : " + basedir );
System.out.println(" ** workingDirectory : " + workingDirectory );
...
When I ran:
mvn release:clean release:prepare -P apache-release -D dryRun=true
then I got:
[INFO] Transforming 'Apache Isis'...
ReleaseUtil#getCommonBaseDir()
reactor project: MavenProject: org.apache.isis:isis-parent:0.1.2-incubating-SN
APSHOT @ D:\svn\ai\branches\release-practice\trunk\pom.xml
- dir : D:/svn/ai/branches/release-practice/trunk
reactor project: MavenProject: org.apache.isis:applib:0.1.2-incubating-SNAPSHO
T @ D:\SVN\ai\branches\release-practice\trunk\applib\pom.xml - dir : D:/SVN/ai/branches/release-practice/trunk/applib
- basedir : D:
getBaseWorkingDirectoryParentCount() - basedir : D:
- workingDirectory : D:\svn\ai\branches\release-practice\trunk
- workingDirectory : D:\svn\ai\branches\release-practice
- workingDirectory : D:\svn\ai\branches
- workingDirectory : D:\svn\ai
- workingDirectory : D:\svn
- workingDirectory : D:\
- workingDirectory : null
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] null
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
at org.apache.maven.shared.release.util.ReleaseUtil.getBaseWorkingDirect
oryParentCount(ReleaseUtil.java:248)
at org.apache.maven.shared.release.phase.RewritePomsForReleasePhase.tran
slateScm(RewritePomsForReleasePhase.java:109)
at org.apache.maven.shared.release.phase.RewritePomsForReleasePhase.tran
sformScm(RewritePomsForReleasePhase.java:62)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transf
ormDocument(AbstractRewritePomsPhase.java:303)
at org.apache.maven.shared.release.phase.AbstractRewritePomsPhase.transf
- basedir : D:
As you can see, the logic to walk up the directory hierarchy blows up. I think this is because 'basedir' itself is wrong (in my case, it ought to be the initial value of workingDirectory, and exit the loop immediately).