0

I know how to do this via SBT: Where does scaladoc look for the rootdoc.txt to create the root doc but cannot figure it out using Maven. Because of defects in SBT, I cannot use SBT for general builds.

Following http://davidb.github.io/scala-maven-plugin/example_doc.html I have the following in my pom.xml

        <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>3.4.4</version>
            <executions>
                <execution>
                    <configuration>
                        <args>
                            <arg>-doc-root-content rootdoc.txt</arg>
                        </args>
                        <jvmArgs>
                            <jvmArg>-Xms1024m</jvmArg>
                            <jvmArg>-Xmx4096m</jvmArg>
                        </jvmArgs>
                    </configuration>
                </execution>
            </executions>
        </plugin>

and

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <reportPlugins>
                    <plugin>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>2.2</version>
                    </plugin>
                    <plugin>
                        <groupId>net.alchim31.maven</groupId>
                        <artifactId>scala-maven-plugin</artifactId>
                        <version>3.4.4</version>
                        <configuration>
                            <args>
                                <arg>-doc-root-content rootdoc.txt</arg>
                            </args>
                            <jvmArgs>
                                <jvmArg>-Xms64m</jvmArg>
                                <jvmArg>-Xmx1024m</jvmArg>
                            </jvmArgs>
                        </configuration>
                    </plugin>
                    ...
                </reportPlugins>
            </configuration>
        </plugin>

It would be really nice to include the root documentation for the API Docs, and not have to use SBT to generate the docs.

Eric Kolotyluk
  • 1,958
  • 2
  • 21
  • 30

1 Answers1

1

<arg> should only contains one argument, not 2. Give a try to

                    <args>
                        <arg>-doc-root-content<arg>
                        <arg>rootdoc.txt</arg>
                    </args>

Notes: idem as SBT with 2 strings :

scalacOptions in Compile ++= Seq("-doc-root-content", "rootdoc.txt")

Updates:

David Bernard
  • 1,560
  • 13
  • 15