LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

mvn-site

generates project documentation website

TLDR

Generate project site into target/site
$ mvn site
copy
Clean and regenerate
$ mvn clean site
copy
Preview the site on a local web server (http://localhost:8080)
$ mvn site:run
copy
Preview on a different port
$ mvn site:run -Dport=[9000]
copy
Generate the site into a specific directory
$ mvn site -DsiteOutputDirectory=[docs]
copy
Generate only the site pages without reports
$ mvn site -DgenerateReports=false
copy
Stage a multi-module site locally to check links
$ mvn site site:stage
copy
Generate and deploy site to the URL in distributionManagement
$ mvn site-deploy
copy

SYNOPSIS

mvn [options] site | site-deploy | site:goal [-Dproperty=value]

DESCRIPTION

mvn site runs the site lifecycle, which uses the Maven Site Plugin to build an HTML website for the project from POM metadata, src/site content (Markdown, APT, XDoc) and reports such as Javadoc, test and dependency reports.Reports are configured in the reporting section of pom.xml; the look and menus come from src/site/site.xml and the chosen skin.

PARAMETERS

site

Lifecycle phase that generates the project website.
site-deploy
Lifecycle phase that generates and deploys the site.
site:run
Serve the site with a local web server, rendering pages on request.
site:stage
Stage the generated site in target/staging for a multi-module build.
site:stage-deploy
Deploy the staged site to a staging location.
site:jar
Bundle the site into a JAR for deployment to a repository.
site:effective-site
Print the effective site descriptor after inheritance and interpolation.
-DsiteOutputDirectory=DIR
Output location (default target/site).
-DgenerateReports=BOOL
Generate reports configured in the reporting section (default true).
-DgenerateProjectInfo=BOOL
Generate the default project info pages (default true).
-Dport=PORT
Port for site:run (default 8080).
-Dmaven.site.skip=true
Skip site generation.
-Dmaven.site.deploy.skip=true
Skip site deployment.

INSTALL

sudo dnf install maven
copy
sudo pacman -S maven
copy
sudo apk add maven
copy
sudo zypper install maven
copy
brew install maven
copy
nix profile install nixpkgs#maven
copy

CAVEATS

Generating reports can be slow and downloads many plugins on first run. Links between modules in a multi-module build only work after site:stage. Deployment requires a distributionManagement/site URL in the POM.

HISTORY

The Maven Site Plugin is part of Apache Maven and has been used since Maven 1 to publish project documentation, including maven.apache.org itself.

SEE ALSO

mvn(1), mvn-deploy(1), javadoc(1), jekyll(1)

RESOURCES

Copied to clipboard
Kai