Generating API with ScalaDoc

Prerequis : common usages

Configuration

to generate apidocs / scaladoc for your scala sources, add this to your pom.xml

<project>
  ...
  <reporting>
    <plugins>
      ...
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
      </plugin>
      ...
    </plugins>
  </reporting>
  ...
</project>

To generate api

Place scala sources files in :

src/main/scala

Then use the standard maven phases :

          
# generate a site
mvn site
       
        

Or the plugin specifics goal :

          
# generate only the doc
mvn scala:doc
        
        

See the result under target/site/scaladocs/

To use a custom api generator

You need to declare the main class to call (with the same parameter as scaladoc). And you need to list the additional artifact(jar) to use :

org.scala_tools.vscaladoc.Mainorg.scala-toolsvscaladoc1.0

Then use the standard maven phases :

          
# generate a site
mvn site
# or generate only the doc
mvn scala:doc
       
        

See the result under target/site/scaladocs/

To use vscaladoc

vscaladoc have a shortcut way to use it (instead of using the custom way describe above) :

1.0

Then use the standard maven phases :

          
# generate a site
mvn site
# or generate only the doc
mvn scala:doc
       
        

See the result under target/site/scaladocs/