You need to add some extensions to your pom:
and use URLs in the SCM format.
For non-subversion SCM, you can include the elements scmVersionType and scmVersion in your settings.xml file to specify a branch or tag to use. The value of scmVersionType must be one of branch or tag. There is no default value for scmVersionType so you MUST specify it with scmVersion in order to have any effect.
There are some shortcomings to simply using Wagon SCM provider with site plugin:
Prefer maven-scm-publish-plugin to publish your site to SCM
Note for Maven 3 users: The site plugin behaves differently, require these be added as dependencies instead of extensions. See Adding a Protocol to Deploy the Site.
Add the following extensions to your pom and use a wagon-scm url in the distributionManagement site url.
<build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-scm</artifactId> <version>2.6</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-manager-plexus</artifactId> <version>1.5</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-provider-svnexe</artifactId> <version>1.5</version> </extension> </extensions> </build> <distributionManagement> <site> <id>my.svn.server</id> <url>scm:svn:https://username@svn.apache.org/svn/root/module</url> </site> </distributionManagement>
Same as before, but changing svnexe to cvsexe and using a CVS svn url.
<build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-scm</artifactId> <version>2.6</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-manager-plexus</artifactId> <version>1.5</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-provider-cvsexe</artifactId> <version>1.5</version> </extension> </extensions> </build> <distributionManagement> <site> <id>my.cvs.server</id> <url>scm:cvs:ext:username@cvs.apache.org:/cvs/root:module</url> </site> </distributionManagement>
Same as before, but changing svnexe to gitexe and using a Git svn url.
<build> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-scm</artifactId> <version>2.6</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-manager-plexus</artifactId> <version>2.6</version> </extension> <extension> <groupId>org.apache.maven.scm</groupId> <artifactId>maven-scm-provider-gitexe</artifactId> <version>2.6</version> </extension> </extensions> </build> <distributionManagement> <site> <id>my.git.server</id> <url>scm:git:ssh://git@github.com/myuser/myproject.git</url> </site> </distributionManagement>
And in your settings.xml file:
<server> <id>my.git.server</id> <username>git</username> <scmVersionType>branch</scmVersionType> <scmVersion>gh-pages</scmVersion> </server>