Fork me on GitHub

Configuring the GitHub credentials

To successfully push the site to GitHub, the plugin needs your GitHub credentials, or at least credentials that can push to the repository.

There are several ways to configure the access:

  • from the Maven settings.xml file using a pair username - password
  • from the plugin configuration (not recommended)

Using username/password or oauth

The easiest way to give access to your repository is to add a server in your settings.xml with your username and password (or from any account that can push to the repository).

In your ~/.m2/settings.xml file, add a server entry as follows:


Using oauth is quite similar. Once you have done all the preliminaries (see [GitHub OAuth support](http://developer, add a server entry as follows:


The server’s id (github) is used in the plugin configuration:

    <!-- Deploy the web site -->
                <!-- must match the server's id  -->

                <!-- The commit message -->
                <message>Building site for my project</message>
                <!-- The location where the site is uploaded -->
                <!-- Use merge or override the content -->

There is another way to configure the server id, avoiding you to write in in the plugin configuration. Set the property:


This snippet can be either in your pom file or in a profile from your settings.xml.

Setting the username and password inside the plugin configuration

This way is not recommended. You can configure the authentication from the plugin configuration with the following parameters:

  • userName (requires the password)
  • password (requires the username)
  • oauth2Token (is sufficient)