Search code examples
javamavenmaven-site-plugin

maven-site-plugin: Configure which page should be the index.html


I have configured the maven-site-plugin the following way:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <version>3.3</version>
    <configuration>
        <skip>${maven.site.plugin.skip}</skip>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>1.3</version>
        </dependency>
    </dependencies>
</plugin>

The site.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
    <publishDate format="yyyy-MM-dd" position="right" />
    <version position="right" />

    <skin>
        <groupId>org.apache.maven.skins</groupId>
        <artifactId>maven-fluido-skin</artifactId>
        <version>1.4</version>
    </skin>

    <custom>
        <fluidoSkin>
            <gitHub>
                <projectId>siom79/japicmp</projectId>
                <ribbonOrientation>right</ribbonOrientation>
                <ribbonColor>gray</ribbonColor>
            </gitHub>
        </fluidoSkin>
    </custom>

    <body>
        <links>
            <item name="Maven" href="http://maven.apache.org/"/>
        </links>
        <breadcrumbs>
            <item name="japicmp" href="https://siom79.github.io/japicmp"/>
        </breadcrumbs>
        <menu name="Overview">
            <item href="Introduction.html" name="Introduction" />
            <item href="CliTool.html" name="CliTool" />
            <item href="MavenPlugin.html" name="MavenPlugin" />
            <item href="Examples.html" name="Examples" />
        </menu>
        <menu ref="reports" inherit="bottom" />
    </body>
</project>

But when I run mvn site:site and mvn site:stage the index.html is the About page. How can I configure that the index.html gets the Introduction.html page?


Solution

  • Meanwhile I have found the answer. Just let the link Introduction point to the file index.html and rename the file Introduction.md to index.md inside the folder src/site/markdown.

        <menu name="Overview">
            <item href="index.html" name="Introduction"/>
            <item href="CliTool.html" name="CliTool" />
            <item href="MavenPlugin.html" name="MavenPlugin" />
            <item href="Examples.html" name="Examples" />
        </menu>