How to add Github authentication to Maven Release Plugin

If you are trying to configure the Maven Release plugin for you project, you might wander how you add the github credentials to the plugin when it trying to push a commit to the github. Well you have to put them in settings.xml in maven not in the project.

So first of all where is the settings.xml is? it reside in maven folder inside conf directory. ( maven -> conf -> settings.xml )

Next is how we define our credentials there? AsĀ ( says we have to define them insideĀ <servers> tags as below


now we have to add a property indicating that into pom.xml. So Maven release plugin will get it. It should like below.


id should be same one you put in settings.xml. Now run Maven release plugin to check it works correctly.