1、Pom.xml中配置maven-site-plugin
在pom.xml中专门定义maven-site-plugin
和maven-project-info-reports-plugin
以及版本号。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
2、Pom.xml指定maven-project-info-reports-plugin版本
如果上面方法没有解决,可以尝试下面方法.
由于将maven-project-info-reports-plugin
更新为3.0.0,并依赖于doxia-site-renderer 1.8
(并且具有org.apache.maven.doxia.siterenderer.DocumentContent
此类),但是maven-site-plugin:3.3
依赖于doxia-site-renderer:1.4
(并且没有org.apache.maven.doxia.siterenderer.DocumentContent
)
指定特定的maven-project-info-reports-plugin
版本:
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</reporting>
或者可以将maven-site-plugin
指定为最新的3.7.1,例如:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
3、Pom.xml中配置build部分Maven网站插件的版本
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>licenses</report>
<report>dependency-info</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
<build>
<plugins>
<!-- Part of Maven - specified version explicitly for compatibility
with the maven-project-info-reports-plugin 3.0.0-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
</plugins>
</build>