Maven Projects

ASF

Usage

The maven-scm-publish-plugin submits modified content to SCM, sites being the most classical case.

The standard use for sites is:

mvn -Preporting site site:stage
mvn scm-publish:publish-scm

which will work both for multi-and mono-modules sites.

Usage With Lifecycle (beta)

There are two ways you can set this up for site in your POM.

Use the Custom Lifecycle

Unfortunately, a Maven plugin can't define a top-level lifecycle like 'site'. However, it can come close. The plugin includes the scmpublish goal. This goal does nothing except fork a custom scmpublish lifecycle, consisting of the following phases:

scmpublish-prepare

scmpublish-pre-site

scmpublish-site

scmpublish-post-site

scmpublish-publish

(Again unfortunately, Maven does not allow a custom lifecycle to share phases with some other lifecycle.)

Notice: this is actually not working, the 003-lifecycle IT has been disabled.

Using the Site Lifecycle

The alternative is to attach the necessary activities to the site lifecycle and deactivate maven-site-plugin's site deploy goal. This requires more XML in the POM, but it may be easier to use if you already customize the site lifecycle for other reasons.