Maven plugin for groovydoc

As all Groovy artifacts and mixed Groovy/Java artifacts must generate javadoc to release to central, this provides a nice mechanism for this to occur. It is intended to be used with the Eclipse Maven plugin and asks Maven for all source directories.

License

License

Categories

Categories

Groovy Languages Maven Build Tools
GroupId

GroupId

com.bluetrainsoftware.maven
ArtifactId

ArtifactId

groovydoc-maven-plugin
Last Version

Last Version

2.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven plugin for groovydoc
As all Groovy artifacts and mixed Groovy/Java artifacts must generate javadoc to release to central, this provides a nice mechanism for this to occur. It is intended to be used with the Eclipse Maven plugin and asks Maven for all source directories.
Source Code Management

Source Code Management

http://github.com/rvowles/groovydoc-maven-plugin

Download groovydoc-maven-plugin

How to add to project

<plugin>
    <groupId>com.bluetrainsoftware.maven</groupId>
    <artifactId>groovydoc-maven-plugin</artifactId>
    <version>2.1</version>
</plugin>

Dependencies

compile (9)

Group / Artifact Type Version
org.apache.maven : maven-artifact jar 3.3.9
org.apache.maven : maven-plugin-api jar 3.3.9
org.apache.maven : maven-project jar 3.0-alpha-2
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4
org.codehaus.plexus : plexus-maven-plugin jar 1.3.8
org.codehaus.groovy : groovy-all jar [2.4.12]
commons-io : commons-io jar 2.4
com.bluetrainsoftware.composite : composite-unit-test jar [1,2)
org.fusesource.jansi : jansi jar 1.2.1

Project Modules

There are no modules declared in this project.

Groovydoc Maven Plugin

No more crazy Ant in your poms.

It turns out, that the javadoc plugin for Maven doesn’t actually generate anything useful for Groovy projects. Further, when releasing artifacts to Apache Maven Central, you actually need Javadocs. So generating Groovydocs (which generates Groovy and Javadocs) turns out to be a fairly good idea, but the only method for doing it turned out to be an Ant task, which is a whole lot of crazy to have in your parent poms.

This plugin encapsulates the functionality of the Groovydoc plugin in its simplest form, package exclusions are not supported, it defaults to public APIs.

Enabling the plugin

Including the following in your POM will enable groovy docs to be generated with a -javadoc.jar extension and javadoc classifier.

<plugin>
  <groupId>com.bluetrainsoftware.maven</groupId>
  <artifactId>groovydoc-maven-plugin</artifactId>
  <version>2.1</version>
  <executions>
    <execution>
      <id>attach-docs</id>
      <phase>package</phase>
      <goals>
        <goal>attach-docs</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Running the plugin directly

Please note, depending on which method of compiling Groovy you are using, you need to make sure that Maven knows about the sources folder. So typically you could:

mvn clean compile groovydoc:generate

Using Maven Tiles

You can use this plugin directly as a tile as each time it is released, you will get a new version flow into your build if you wish.

  <tile>com.bluetrainsoftware.maven:groovydoc-maven-plugin:[1.3,2)</tile>

See the Maven Tiles plugin for more information.

Overrides

All of the known overrides can be specified, some do not work however (such as specifying excludes and includes). If there is a calling for it, I can implement it.

e.g.

<plugin>
  <groupId>com.bluetrainsoftware.maven</groupId>
  <artifactId>groovydoc-maven-plugin</artifactId>
  <version>2.1</version>
  <executions>
    <execution>
      <id>attach-docs</id>
      <goals>
        <goal>attach-docs</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <scope>private</scope>
  </configuration>
</plugin>

Release Notes

1.3 - Javadoc Nuking

When releasing, the javadoc plugin is run regardless of your desire to have it run. This version fixes that so you don’t have to have it running.

  • forces the javadoc plugin to be skipped unless <forceSkipJavadoc>false</forceSkipJavadoc> is in your configuration.

2.1 - Upgrade to Groovy 2.4.12

Some internal package rejigging, but essentially just a Groovy upgrade.

Versions

Version
2.1
1.3
1.2