Usage

You need to add some extensions (wagon-scm, maven-scm-manager-plexus and the maven SCM provider for your SCM system; see the example below) to your POM and specify a site URL in the git SCM format.

Deploying your Maven site to GitHub

Add the following extensions to your POM and use a wagon-gitsite url in the distributionManagement site url.

  <build>
    ...
    <extensions>
      <extension>
        <groupId>org.apache.maven.scm</groupId>
        <artifactId>maven-scm-provider-gitexe</artifactId>
        <version>1.3</version>
      </extension>
      <extension>
        <groupId>org.apache.maven.scm</groupId>
        <artifactId>maven-scm-manager-plexus</artifactId>
        <version>1.3</version>
      </extension>
      <extension>
        <groupId>org.kathrynhuxtable.maven.wagon</groupId>
        <artifactId>wagon-gitsite</artifactId>
        <version>0.4</version>
      </extension>
    </extensions>
  </build>
  ...
  <distributionManagement>
    ...
    <site>
      <id>github-project-site</id>
      <url>gitsite:git@github.com/tomjones/my-project.git</url>
    </site>
  </distributionManagement>

You may add an alternate branch following the repository name, separated with a colon (:) if you wish, e.g.

<url>gitsite:git@github.com/tomjones/my-project.git:my-branch</url>

will deploy the site to the my-branch branch instead of the gh-pages branch.

You might also need to add the following to your ~/.m2/settings.xml

  ...
  <servers>
    ...
    <server>
      <id>github-project-site</id>
      <username>git</username>
    </server>
    ...
  </servers>
  ...