Search code examples
mavenjavadocmaven-javadoc-plugin

Maven javadoc + custom doclet


How can i specify the doclect artifact when calling mvn from command line

mvn clean install javadoc:javadoc -Ddoclet=my.Doclet -DdocletArtifact=????

Solution

  • You should add something like this to your pom.xml:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclet>my.doclet</doclet>
          <docletArtifact>
            <groupId>my.artifact.group</groupId>
            <artifactId>my.artifact.id</artifactId>
            <version>my.artifact.version</version>
          </docletArtifact>
        </configuration>
      </plugin>
    

    This is also documented in detail in section Using Alternate Doclet of the Apache Maven Javadoc Plugin documentation.

    You cannot simply specify these parameters from the command line, but using a Build Profile may help you selecting the configuration you want to have.