The Maven Site Plugin is used to generate a site for the project. It can be used for documentation purpose including the project’s reports which were configured in the POM.
Goals:
- site:site is used generate a site for a single project.
- site:run starts the site up, rendering documents as requested for faster editing. It uses Jetty as the web server.
- site:jar bundles the site output into a JAR so that it can be deployed to a repository.
Configuration:
<plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> <version>3.9.0</version> <configuration> <port>9000</port> <tempWebappDirectory>${basedir}/target/site/tempdir</tempWebappDirectory> </configuration> </plugin> </plugins>
Run the following maven command to deploy your site to local host:
mvn site:run
Launch the site in browser – https://localhost:9000