You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jeremy (JIRA)" <ji...@codehaus.org> on 2008/07/01 11:36:26 UTC

[jira] Created: (MINVOKER-41) NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location

NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location
--------------------------------------------------------------------------------------------------------

                 Key: MINVOKER-41
                 URL: http://jira.codehaus.org/browse/MINVOKER-41
             Project: Maven 2.x Invoker Plugin
          Issue Type: Bug
    Affects Versions: 1.2
         Environment: $ mvn --version
Maven version: 2.0.8
Java version: 1.6.0_06
OS name: "linux" version: "2.6.24-19-generic" arch: "i386" Family: "unix"

            Reporter: Jeremy


Assume that the mvn executable cannot be found at the expected location, then InvokerMojo::runBuild throws a NullPointerException at line 787 (same line number in the trunk version). Indeed, looking at InvokerMojo.java, if an exception is catched in the try clause line 777 (from the invoker.execute method call), then "result" remains unaffected and the method call line 787 fails.

I attach the InvokerMojo.java file as I get it from the svn repository, a "mvn -e -X install > log" file and one of the POM that triggers the problem.


-- 
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: (MINVOKER-41) NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location

Posted by "Jeremy (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MINVOKER-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140083#action_140083 ] 

Jeremy commented on MINVOKER-41:
--------------------------------

Simple. I use the maven2 Ubuntu package. I don't know how it has been built. But what I've seen is that most of the Maven stuffs are installed in the "/usr/share/maven2" directory. But the "mvn" executable is put in "/usr/bin", while it is expected to be found in the "/usr/share/maven2/bin" directory, along with the rest of Maven.
The workaround is as easy as a "ln -s /usr/bin/mvn /usr/share/maven2/bin/mvn".

> NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location
> --------------------------------------------------------------------------------------------------------
>
>                 Key: MINVOKER-41
>                 URL: http://jira.codehaus.org/browse/MINVOKER-41
>             Project: Maven 2.x Invoker Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: $ mvn --version
> Maven version: 2.0.8
> Java version: 1.6.0_06
> OS name: "linux" version: "2.6.24-19-generic" arch: "i386" Family: "unix"
>            Reporter: Jeremy
>
> Assume that the mvn executable cannot be found at the expected location, then InvokerMojo::runBuild throws a NullPointerException at line 787 (same line number in the trunk version). Indeed, looking at InvokerMojo.java, if an exception is catched in the try clause line 777 (from the invoker.execute method call), then "result" remains unaffected and the method call line 787 fails.
> I attach the InvokerMojo.java file as I get it from the svn repository, a "mvn -e -X install > log" file and one of the POM that triggers the problem.

-- 
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: (MINVOKER-41) NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MINVOKER-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140071#action_140071 ] 

Benjamin Bentmann commented on MINVOKER-41:
-------------------------------------------

Yep, I see what you mean (Eclipse marks line 787 as a potential null pointer access). Seems like we should add a {{return}} statement to the {{catch}} block to quit the method.

Can you describe in some more detail what makes the plugin fail to locate your Maven executable? I.e. besides from the bad exception handling, is there something we could improve about the way the executable is located?

> NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location
> --------------------------------------------------------------------------------------------------------
>
>                 Key: MINVOKER-41
>                 URL: http://jira.codehaus.org/browse/MINVOKER-41
>             Project: Maven 2.x Invoker Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: $ mvn --version
> Maven version: 2.0.8
> Java version: 1.6.0_06
> OS name: "linux" version: "2.6.24-19-generic" arch: "i386" Family: "unix"
>            Reporter: Jeremy
>
> Assume that the mvn executable cannot be found at the expected location, then InvokerMojo::runBuild throws a NullPointerException at line 787 (same line number in the trunk version). Indeed, looking at InvokerMojo.java, if an exception is catched in the try clause line 777 (from the invoker.execute method call), then "result" remains unaffected and the method call line 787 fails.
> I attach the InvokerMojo.java file as I get it from the svn repository, a "mvn -e -X install > log" file and one of the POM that triggers the problem.

-- 
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: (MINVOKER-41) NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location

Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MINVOKER-41?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Bentmann closed MINVOKER-41.
-------------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 1.3

Fixed NPE in [r673206|http://svn.apache.org/viewvc?view=rev&revision=673206].

Regarding the symlink workaround: If I understand Paul Cager's comment in MINVOKER-28 correctly, this should be part of the new Debian/Ubuntu packages.

> NullPointerException in InvokerMojo::runBuild in case the mvn executable is not at the expected location
> --------------------------------------------------------------------------------------------------------
>
>                 Key: MINVOKER-41
>                 URL: http://jira.codehaus.org/browse/MINVOKER-41
>             Project: Maven 2.x Invoker Plugin
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: $ mvn --version
> Maven version: 2.0.8
> Java version: 1.6.0_06
> OS name: "linux" version: "2.6.24-19-generic" arch: "i386" Family: "unix"
>            Reporter: Jeremy
>            Assignee: Benjamin Bentmann
>             Fix For: 1.3
>
>
> Assume that the mvn executable cannot be found at the expected location, then InvokerMojo::runBuild throws a NullPointerException at line 787 (same line number in the trunk version). Indeed, looking at InvokerMojo.java, if an exception is catched in the try clause line 777 (from the invoker.execute method call), then "result" remains unaffected and the method call line 787 fails.
> I attach the InvokerMojo.java file as I get it from the svn repository, a "mvn -e -X install > log" file and one of the POM that triggers the problem.

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