Question

I'd like to set an alternate JavaDoc location for all my modules in a multi-module maven project. Unfortunately, I have to rely on relative paths, or else use maven properties like ${basedir}, since this is a team project on subversion, and no absolute path will be the same for all of us.

What is the best way to do this? If I have a project structure

parent
   sub1
   sub2
   sub3
      docs

And I want to place the API in sub3/docs, then how can I point all my modules to output HTML files in sub3/docs, when the parent module will recognize a different path to it than the submodules?

Thanks in advance.

Was it helpful?

Solution

You want to pollute your project build as little as possible, especially with repeated build tweaks. Instead, you're better off creating a separate build process that assembles the javadoc output from its standard location in all projects and publishes it somewhere desirable.

OTHER TIPS

Add the following to the parent pom and make sure the child pom does not define their own javadoc plugin.

       <build>
       <plugins>
       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.7</version>

            <configuration>
                <outputDirectory>${project.parent.basedir}/sub3</outputDirectory>
                <reportOutputDirectory>${project.parent.basedir}/sub3</reportOutputDirectory>
                <destDir>docs</destDir>
            </configuration>
        </plugin>
        </plugins>
        </build>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top