Adding a Protocol to Deploy the Site

Out of the box, Maven 3 only supports file:, http: and https: as transport protocols. Maven 2 adds scp: to this list.

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

  1. [ERROR]
  2. Unsupported protocol: '...' for site deployment to distributionManagement.site.url=...
  3. Currently supported protocols are: ...
  4. Protocols may be added through wagon providers.
  5. 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 at as a dependency of the site plugin:

  1. <project>
  2. ...
  3. <build>
  4. <pluginManagement>
  5. <plugins>
  6. <plugin>
  7. <groupId>org.apache.maven.plugins</groupId>
  8. <artifactId>maven-site-plugin</artifactId>
  9. <version>3.6</version>
  10. <dependencies>
  11. <dependency><!-- add support for ssh/scp -->
  12. <groupId>org.apache.maven.wagon</groupId>
  13. <artifactId>wagon-ssh</artifactId>
  14. <version>1.0</version>
  15. </dependency>
  16. </dependencies>
  17. </plugin>
  18. </plugins>
  19. </pluginManagement>
  20. </build>
  21. ...
  22. </project>