Configuring the Maven Site Plugin to accept scp-URLs for site:deploy
I ran into a slightly puzzling problem while upgrading from Maven2 to Maven3 this week. In hindsight the solution wasn’t all that complicated but it threw me a little because Maven is usually quite good at pulling all its required dependencies.
Basically, I was having trouble uploading files generated by Maven’s site plugin to a host. The URL was specified as follows
In Maven2 this worked out of the box without extra configuration.
In Maven3 this threw the following error during site-deploy
:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:2.2:deploy
(default-cli) on project $PROJECT_NAME: Unsupported protocol: 'scp':
Cannot find wagon which supports the requested protocol:
scp: java.util.NoSuchElementException
The trouble was that the Site Plugin apparently doesn’t automatically pull the Apache Wagon SSH implementation. You have to tell it manually to do that like this: