I have a multi-module Maven build and I would like to generate an aggregated Scaladoc in my root module, similar to what the aggregate goal for the maven-javadoc-plugin does. My
This doesn't answer the question exactly as asked, but is a solution that may actually be preferred for mixed java/scala projects until ScalaDoc is capable of parsing JavaDoc comments. It produces a single aggregated JavaDoc that includes documentation from all of the project's Scala source files as well.
The solution is simple: configure Maven to use the GenJavaDoc Scala compiler plugin so that ScalaDocs can be converted to JavaDocs. Then, use the normal javadoc:aggregate
goal to aggregate the project as normal.
Here is a sample Maven profile to do this. It configures the Scala compiler to generate the JavaDocs corresponding to the Scala sources, configures Maven to treat the genjavadoc
directory created by the Scala compiler as a source directory, and then configures the javadoc plugin itself (this last may be optional if you have no special JavaDoc plugin configuration requirements).
javadoc
net.alchim31.maven
scala-maven-plugin
doc
generate-sources
compile
-P:genjavadoc:out=${project.build.directory}/genjavadoc
com.typesafe.genjavadoc
genjavadoc-plugin_${scala.binary.full.version}
0.4
org.codehaus.mojo
build-helper-maven-plugin
generate-sources
add-source
org.apache.maven.plugins
maven-javadoc-plugin
2.9
64m
2g
${project.build.directory}
true