简体   繁体   English

maven-site-plugin:配置哪个页面应为index.html

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

I have configured the maven-site-plugin the following way: 我已经通过以下方式配置了maven-site-plugin:

<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: site.xml如下所示:

<?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. 但是,当我运行mvn site:sitemvn site:stage ,index.html是“关于”页面。 How can I configure that the index.html gets the Introduction.html page? 如何配置index.html获取Introduction.html页面?

The page is generated by the org.apache.maven.plugins:maven-project-info-reports-plugin:index , but based on the available parameters you can't change the filename. 该页面由org.apache.maven.plugins:maven-project-info-reports-plugin:index生成 ,但是基于可用参数,您不能更改文件名。 What you can do is create your own src/site/xdox/index.xml , containing a reload/redirect to Introduction.html Or just rename Introduction.html to index.html, just like everybody expects. 您可以做的是创建自己的src/site/xdox/index.xml ,其中包含重新加载/重定向到Introduction.html,或者像大家期望的那样,将Introduction.html重命名为index.html。

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 . 只需将链接Introduction指向文件index.html并将文件Introduction.md重命名为src/site/markdown文件夹内的index.md

    <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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么 maven java 项目中存在`maven-site-plugin` - Why `maven-site-plugin` present in maven java project Maven站点插件无法加载生成的源(Jaxb) - Maven-site-plugin could not load generated sources (Jaxb) Maven站点插件: <body> 标签没有被继承 - maven-site-plugin: <body> tag is not being inherited Asciidoctor maven 插件正在生成没有读取权限的 index.html - Asciidoctor maven plugin is generating index.html with no read permissions 启动板抱怨缺少maven-site-plugin,但我根本不使用它 - launchpad complains about missing maven-site-plugin but I do not use it at all 如何将站点的主页重定向到/public/index.html路径 - How to redirect the home page of the site to /public/index.html path 错误:maven-site-plugin:3.7.1 或其依赖项之一无法解析 - Error: maven-site-plugin:3.7.1 or one of its dependencies could not be resolved 无法配置Spring Security仅加载默认页面或将其发送到/templates/index.html来加载.loginPage(“ / login”) - Cannot configure Spring Security to load .loginPage(“/login”) only the default page works or it sends to /templates/index.html 无法执行目标org.apache.maven.plugins:maven-site-plugin:3.7:site(default-cli):常量池中的无效字节标记:18 - Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.7:site (default-cli): Invalid byte tag in constant pool: 18 在Jboss服务器中如何配置页面index.html从机器ip而不是localhost调用 - In Jboss server how to configure page index.html to be called from machine ip instead of localhost
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM