You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dan Haywood (JIRA)" <ji...@codehaus.org> on 2011/05/19 06:26:22 UTC

[jira] Created: (MRELEASE-680) Fails on cygwin with multiline module with nullpointer exception.

Fails on cygwin with multiline module with nullpointer exception.
-----------------------------------------------------------------

                 Key: MRELEASE-680
                 URL: http://jira.codehaus.org/browse/MRELEASE-680
             Project: Maven 2.x Release Plugin
          Issue Type: Bug
          Components: prepare
    Affects Versions: 2.0
         Environment: cygwin on Windows 7 (and probably earlier Windows versions too).
            Reporter: Dan Haywood


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


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).



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRELEASE-680) Fails on cygwin with multiline module with nullpointer exception.

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267474#action_267474 ] 

Dennis Lundberg commented on MRELEASE-680:
------------------------------------------

Can you please run your test case using version 2.1 of the Release Plugin. Just to make sure that the issue hasn't already been fixed.

> Fails on cygwin with multiline module with nullpointer exception.
> -----------------------------------------------------------------
>
>                 Key: MRELEASE-680
>                 URL: http://jira.codehaus.org/browse/MRELEASE-680
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0
>         Environment: cygwin on Windows 7 (and probably earlier Windows versions too).
>            Reporter: Dan Haywood
>
> 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
> 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).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (MRELEASE-680) Fails on cygwin with multiline module with nullpointer exception.

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MRELEASE-680?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg closed MRELEASE-680.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1

> Fails on cygwin with multiline module with nullpointer exception.
> -----------------------------------------------------------------
>
>                 Key: MRELEASE-680
>                 URL: http://jira.codehaus.org/browse/MRELEASE-680
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0
>         Environment: cygwin on Windows 7 (and probably earlier Windows versions too).
>            Reporter: Dan Haywood
>             Fix For: 2.1
>
>
> 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
> 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).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (MRELEASE-680) Fails on cygwin with multiline module with nullpointer exception.

Posted by "Dan Haywood (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MRELEASE-680?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=267517#action_267517 ] 

Dan Haywood commented on MRELEASE-680:
--------------------------------------

Woohoo.  Looks like it does work on 2.1.  I guess you can close.

> Fails on cygwin with multiline module with nullpointer exception.
> -----------------------------------------------------------------
>
>                 Key: MRELEASE-680
>                 URL: http://jira.codehaus.org/browse/MRELEASE-680
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0
>         Environment: cygwin on Windows 7 (and probably earlier Windows versions too).
>            Reporter: Dan Haywood
>
> 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
> 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).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira