0

I just downloaded Maven-3.8.5 yesterday and have been going through the tutorials trying to get up to speed. 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.

Below is my pom.xml file.

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

Dan
  • 3,647
  • 5
  • 20
  • 26
  • 1
    There is no configuration of reporting see for details: https://maven.apache.org/plugins/maven-site-plugin/examples/configuring-reports.html furthermore you are using very old versions of maven-site-plugin ... also using a very old version of JUnit 4... also if you run JDK11 you can use `11` instead of source/target.. – khmarbaise May 27 '22 at 20:20

1 Answers1

0

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.

You can then further customize your site (site.xml), and the reports added to the site, by following the documentation:

For issues with the default site & report plugins included in maven 3 see:

slindenau
  • 1,091
  • 2
  • 11
  • 18