简体   繁体   English

Maven“mvn site”命令不生成任何文档

[英]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.

相关问题 Maven PMD插件没有使用&#39;mvn site&#39;命令或&#39;pmd:pmd&#39;生成报告 - Maven PMD plug-in not generating a report with 'mvn site' command or 'pmd:pmd' 生成Maven文档时出错 - Error generating maven documentation 使用mvn site:deploy命令后,无法使用WebDAV协议将项目文档发布到Apache - Not able to publish project documentation to Apache using WebDAV protocol after using mvn site:deploy command maven通过mvn网站引用多个模块 - maven multiple modules reference through mvn site 为什么 Maven 命令“mvn sonar:sonar”在我的“pom.xml”中没有任何插件配置的情况下工作? - Why does the Maven command “mvn sonar:sonar” work without any plugin configuration in my “pom.xml”? 使用mvn命令部署maven应用程序的问题 - problems deploying a maven application with mvn command 当运行&#39;mvn package&#39;命令时,Maven无法正常工作 - Maven not working when 'mvn package' command is run 使用“ mvn install”命令进行Maven构建失败 - Maven Build Failure with “mvn install” command 命令行无法识别mvn(maven) - command line does not recognise mvn(maven) Maven在“ MVN网站”期间引发错误,但在“ MVN编译” /“ MVN测试”中可以正常工作 - Maven throwing error during “mvn site” but works fine with “mvn compile”/“mvn test”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM