Apache

Docs Plugins

Site Plugin 3.22.0 · Other versions

The Maven Site Plugin is a plugin that generates a site for the current project.

Source
Edit this page
Wrong?
Report a problem

Adding a Protocol to Deploy the Site

Out of the box, Maven and Site Plugin only supports file:, http(s): and dav+http(s): (for WebDAV) as transport protocols.

If you try to deploy a site with an unsupported protocol, you'll get an error:

[ERROR] 
Unsupported protocol: '...' for site deployment to distributionManagement.site.url=...
Currently supported protocols are: ...
    Protocols may be added through wagon providers.
    For more information, see http://maven.apache.org/plugins/maven-site-plugin/examples/adding-deploy-protocol.html

As explained in the error message, to deploy a site with a non-built-in protocol, you need to add the corresponding wagon provider.

You can add it either as a global extension, or declare it as a dependency of the site plugin:

<project>
  ...
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.22.0</version>
          <dependencies>
            <dependency><!-- add support for sftp/scp -->
              <groupId>org.apache.maven.wagon</groupId>
              <artifactId>wagon-ssh</artifactId>
              <version>3.5.3</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  ...
</project>

Although deployment to SCM (Source Control Management) systems (e.g. SVN, Git, Mercury) is supported also by Wagon SCM provider that wagon provider is currently committing each file separately which is not desirable in the context of site deployment. Therefore, it is recommended to use the Maven SCM Publish Plugin for SCM deployment instead which pushes all files in a single commit.