Hey,

wanted to try the DOAP plugin[1] but ran into some problems:

1) When you don't specify an <developerConnection> element inside your
POMs <scm> element you'll get a NullPointerException as follows:

[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 Code in question assumes that the developer connection is always
specified and therefore runs into trouble if it is not. Easiest way
around this is to specify the developer connection or on the code side
replace

        String developerConnection = scm.getDeveloperConnection();
        writeSourceRepository( writer, developerConnection );

with

        String developerConnection = scm.getDeveloperConnection();
        if (developerConnection != null) {
                writeSourceRepository( writer, developerConnection );
        }

This is (of course) just a proposal and it should/must be applied to
the anonymous SCM connection as well or you'll run into trouble again
if someone does not specify that.


2) The plugin documentation is wrong regarding the site integration[2].
It states that you have to add an additional meta tag which hrefs

        "${project.url}/doap_maven-doap-plugin.rdf"

But the plugin calls the final .rdf file doap_${artifactId} so the
above line should read:

        "${project.url}/doap_${artifactId}.rdf"


Apart from that, the plugin rocks!

Greets


[1]: http://maven.apache.org/plugins/maven-doap-plugin/
[2]:
http://maven.apache.org/plugins/maven-doap-plugin/examples/with-site-plugin.html

Attachment: signature.asc
Description: PGP signature

Reply via email to