Please find below an example pom.xml
.
To generate the javadoc the following command needs to be run:
mvn javadoc:javadoc
The documentation for the maven-javadoc-plugin can be found here.
<?xml version="1.0" encoding="UTF-8"?> | |
<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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.example</groupId> | |
<artifactId>validation-example</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<properties> | |
<maven.compiler.source>21</maven.compiler.source> | |
<maven.compiler.target>21</maven.compiler.target> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
</properties> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>org.junit</groupId> | |
<artifactId>junit-bom</artifactId> | |
<version>5.10.1</version> | |
<type>pom</type> | |
<scope>import</scope> | |
</dependency> | |
</dependencies> | |
</dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>org.junit.jupiter</groupId> | |
<artifactId>junit-jupiter</artifactId> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.assertj</groupId> | |
<artifactId>assertj-core</artifactId> | |
<version>3.24.2</version> | |
<scope>test</scope> | |
</dependency> | |
</dependencies> | |
<build> | |
<plugins> | |
<plugin> | |
<artifactId>maven-surefire-plugin</artifactId> | |
<version>3.2.1</version> | |
</plugin> | |
</plugins> | |
</build> | |
<reporting> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-javadoc-plugin</artifactId> | |
<version>3.6.3</version> | |
<configuration> | |
<source>21</source> <!-- please use a variable instead, e.g. ${maven.compiler.source} --> | |
<target>21</target> <!-- please use a variable instead, e.g. ${maven.compiler.target} --> | |
</configuration> | |
</plugin> | |
</plugins> | |
</reporting> | |
</project> |