Plugin assumes that both <connection> and <developerConnection> are always 
specified
------------------------------------------------------------------------------------

                 Key: MDOAP-23
                 URL: http://jira.codehaus.org/browse/MDOAP-23
             Project: Maven 2.x DOAP Plugin
          Issue Type: Bug
    Affects Versions: 1.0
            Reporter: Sebastian Hoß
         Attachments: maven-doap-plugin - scm connection.patch

While trying out the DOAP plugin I ran into the following NPE:

[INFO] [doap:generate {execution: site}]
[INFO] Generating a pure DOAP file...
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException
        at
org.apache.maven.plugin.doap.DoapMojo.writeSourceRepository(DoapMojo.java:1062)
        at
org.apache.maven.plugin.doap.DoapMojo.writeSourceRepositories(DoapMojo.java:1009)
        at
org.apache.maven.plugin.doap.DoapMojo.execute(DoapMojo.java:378)
...


The _writeSourceRepositories_ method assumes that both the anonymous 
<connection> and the <developerConnection> are specified. If they are not the 
follow-up method (_writeSourceRepository_) will throw a NullPointerException 
while trying to do compute *connection.length() < 4*

The attached patch corrects this inside the _writeSourceRespositories_ method 
by checking if those connections are really specified. Only if they are the 
follow-up method is called.

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


Reply via email to