[英]Maven "mvn site" command not generating any documentation
I just downloaded Maven-3.8.5 yesterday and have been going through the tutorials trying to get up to speed.我昨天刚刚下载了 Maven-3.8.5,并且一直在阅读教程以加快速度。 I was able to successfully create a project and clean/build/test it.
我能够成功创建一个项目并清理/构建/测试它。 However, when I try to run 'mvn site' the build is successful but for some reason it does not generate anything in the site folder apart from css & images.
但是,当我尝试运行“mvn site”时,构建成功,但由于某种原因,除了 css 和图像之外,它不会在站点文件夹中生成任何内容。
Below is my pom.xml file.下面是我的 pom.xml 文件。
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.companyname.bank</groupId>
<artifactId>consumerBanking</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>consumerBanking</name>
<url>http://maven.apache.org</url>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Any help is greatly appreciated, thanks!非常感谢任何帮助,谢谢!
It seems to be an issue in the specific site and report plugin versions you've selected.这似乎是您选择的特定站点和报告插件版本中的问题。 I've reproduced your "empty" site with those versions.
我已经用这些版本复制了你的“空”网站。
Try upgrading the plugins to the latest version, these work for me:尝试将插件升级到最新版本,这些对我有用:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.12.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.3.0</version>
</plugin>
See for available versions查看可用版本
This will generate the default "look & feel" maven project site.这将生成默认的“外观”maven 项目站点。
You can then further customize your site ( site.xml
), and the reports added to the site, by following the documentation:然后,您可以按照文档进一步自定义您的站点 (
site.xml
),以及添加到站点的报告:
For issues with the default site & report plugins included in maven 3 see:有关 maven 3 中包含的默认站点和报告插件的问题,请参阅:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.