Maven javadoc + custom doclet

1.8k views Asked by At

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

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

There are 1 answers

1
Torsten On BEST ANSWER

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.