I have multi-module maven project. I can see generated project dosumentation after mvn site, but it is in every module target folder.

how to get maven project site into one folder? (I don't really need to deploy, I will put generated site manually into GitHub pages.)

Plugin docs:

http://maven.apache.org/plugins/maven-site-plugin/

References <distributionManagement> <site> section, but there is no trace how to make output into a defined folder. Also tried mvn site:jar - it make .jar again in every module target.

有帮助吗?

解决方案

I would recommend to use the site-maven-plugin following part to distribute generated sites to github:

<profile>
  <id>github</id>
  <build>
    <plugins>
      <plugin>
        <groupId>com.github.github</groupId>
        <artifactId>site-maven-plugin</artifactId>
        <version>0.8</version>
        <configuration>
          <message>Creating site for ${project.version}</message>
          <server>github</server>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>site</goal>
            </goals>
            <phase>post-site</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</profile>

To preview your site before publishing you can use the stage goal of maven-site-plugin like this:

mvn site:stage -DstagingDirectory=C:\fullsite
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top