maven-javadoc-plugin target-directory of aggregated docs

匆匆过客 提交于 2019-12-25 09:19:15

问题


I have an issue concerning the target directory of aggregated javadocs.

What I have is:

A maven project containing several modules. It looks a bit like the one used as example here

Project
  |-- directory_to_contain_docs/
  |-- pom.xml
  |-- Module1
  |   `-- pom.xml
  |-- Module2
  |   `-- pom.xml
  `-- Module3
    `-- pom.xml

I can't get it done to make javadoc generate the documentation in the directory named "directory_to_contain_docs".

This is what I tried:

I call the generation with "mvn javadoc:aggregate". And this is a part of the pom.xml:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <configuration>
                <!-- Default configuration for all reports -->
                <failOnError>false</failOnError>

                <destDir>${basedir}/directory_to_contain_docs</destDir>
                <!-- as there are lots of incorrectly documented sources -->
                <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
            <executions>
                <execution>
                    <id>aggregate</id>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                    <phase>site</phase>
                    <configuration>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

The javadoc is always generated in {project}/target/site/apidocs, the generation creates the complete path given in destDir beneath that directory. I am looking for a way to have the whole docs somewhere else.

Is there a chance to achieve that?

Thanks, Ishiido


回答1:


Don't know why I did not see it... The missing link is configuration/reportOutputDirectory. It specifies the directory where the documentation is generated. It may be specified further by destDir.



来源:https://stackoverflow.com/questions/44454577/maven-javadoc-plugin-target-directory-of-aggregated-docs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!