Maven DocCheck Plugin and NetBeans Platform Applications

Yesterday I answered one unanswered question from the Poznan NetBeans Platform Certified Training. Today, another one. It comes from Grzegorz Buszkiewicz who wants to use Maven DocCheck Plugin for a NetBeans Platform application developed in NetBeans IDE.

Here's a rough guide to how I set it up and managed to get it working.

  1. Download (from here) and then unzip the DocCheck doclet JAR.

  2. On the command line, find your way to the directory where you unzipped the above JAR and then run this:
    mvn install:install-file -Dfile=doccheck.jar -DgroupId=com.sun.tools.doclets -DartifactId=doccheck -Dversion=1.2b2 -Dpackaging=jar -DgeneratePom=true

  3. Add the following to the "pom.xml" of the module where you want to apply the DocCheck (or add it to the top level pom.xml to apply it to all modules):
    <project>
    ...
    ...
    ...
        <reporting>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.6.1</version>
                    <reportSets>
                        <reportSet>
                            <id>html</id>
                            <reports>
                                <report>javadoc</report>
                            </reports>
                        </reportSet>
                        <reportSet>
                            <id>doccheck</id>
                            <configuration>
                                <name>DocCheck</name>
                                <description>DocCheck documentation</description>
                                <doclet>com.sun.tools.doclets.doccheck.DocCheck</doclet>
                                <docletArtifact>
                                    <groupId>com.sun.tools.doclets</groupId>
                                    <artifactId>doccheck</artifactId>
                                    <version>1.2b2</version>
                                </docletArtifact>
                                <destDir>doccheck</destDir>
                            </configuration>
                            <reports>
                                <report>javadoc</report>
                            </reports>
                        </reportSet>
                    </reportSets>
                </plugin>
            </plugins>
        </reporting>
      ...
      ...
      ...
    </project>

  4. Now right-click the module and add a new action in the Actions tab. I named it "Reports". Then add "javadoc: javadoc site:site", as shown below:

  5. Now close the above dialog, right-click the module, and choose Custom | Reports and then the above action will be run.

  6. When everything is finished processing, go to the Files window, and you should see a "doccheck" folder containing the generated files:

    Now you'll have useful doc-related info for your code, such as here:

Not sure if all the steps above are needed, or whether it is optimal, but at least it works!

In other news. Read Milos Kleint's blog today to find out how to use NetBeans annotations in Maven-driven NetBeans Platform projects!

Comments:

Thank you for answering my question Geertjan!
I got it to work but not without problems - maybe the problem appears only od Windows XP.

Long story short: after following you advice I got:
Exit code: 1 - javadoc: error - invalid flag: -author

As it turns out in the maven generated javadoc options file there were flags not supported by DocCheck (-author for example) - removing them manually and running javadoc.bat fixed it.
Maybe something is wrong with the Maven DocCheck Plugin for Windows XP itself

Posted by Grzegorz Buszkiewicz on January 21, 2010 at 05:14 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today