maven project-reports.html vs index.html

杀马特。学长 韩版系。学妹 提交于 2019-12-06 07:21:50

问题


I have a multi module pom

ProjectBaseDir>

  • Module A
  • Module B
  • parentPom.xml

I don't have any site.xml

ProjectBaseDir> mvn clean site

produces the below files under the directory

ProjectBaseDir/target/site>

  • cpd.html, pmd.html, findbugs.html
  • project-reports.html (Note: no index.html)
  • folders (css, images, apidocs)

Links generated in multi module pom points to "index.html" but that file is not created. staging fixes the relative path of the module files but the original issue of index.html still exists

ProjectBaseDir> mvn site:stage
  1. How can I fix the link to point to "project-reports.html" ?
  2. Or how can I instruct mvn site to create index.html instead of project-reports.html ?

Note: I tried "maven-project-info-reports-plugin" with reportsets of index but it did not change anything.


回答1:


This might not help, but I had setup the maven-site-plugin with an explicit reportinPlugins config section in an effort to get javadoc generation with mvn site working on jdk8. It looked like this

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.6</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <configuration>
                                <additionalparam>${javadoc.opts}</additionalparam>
                            </configuration>
   </plugin>

My issue was that the project info reporting plugin was never firing, nor was anything else in the reporting plugin section of the parent pom. The fix was to remove the reportPlugins child of maven site, like this

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.6</version>
</plugin>

Apparently when it is defined, it's a replacement, not just a configure a plugin type of thing.



来源:https://stackoverflow.com/questions/36752020/maven-project-reports-html-vs-index-html

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