Configuring Site Run

For the site:run goal, you can configure which port to use to start up the site as well as the directory where the pages for the site will be rendered.

For example, you can have the following configuration in your POM:

<project>
  ...
  <build>
    <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>
  </build>
  ...
</project>

When you execute "mvn site:run", you will see in the command line that the Jetty server is started at port 9000. To access the site, type http://localhost:9000 in your browser. You will also see that the dummy web application is generated in the ${basedir}/target/site/tempdir directory as specified by the tempWebappDirectory parameter.