title: Maven release in gitlab
body: <p>We are trying to perform a maven release using maven. We are using <strong>gitlab</strong> as our CI tool. Issue is when we tried to perform maven release, maven isn not able to 
  update <strong>pom.xml</strong> to next iteration.</p>
  
  <p><em>Google</em> is out of answer for my issue.
  What I have tried is:</p>
  
  <ul>
  <li>tried to check permissions for the user who is trying to push(Has master access on the repo and the branch is protected)</li>
  <li>Masters have access to push protected branches in my repo.</li>
  </ul>
  
  <p>Below is my .gitlab-ci.yml file- </p>
  
  <pre><code>    Maven_Release:
      stage: Maven_Release
      image: maven_Build:Latest
      script:
      - git config --global user.name "username"
      - git config --global user.email "Email"
      - git checkout -f master
      - git remote set-url origin https://gitlab.com/test1/project/${CI_PROJECT_NAME}.git
      - mkdir -p ~/.ssh
      - echo "$SSH_PRIVATE_KEY" &gt; /root/.ssh/id_rsa
      - ssh-keyscan -p 10022 gitlab.com &gt;&gt; ~/.ssh/known_hosts
      - mvn -B -s settings.xml -DdeployAtEnd=false -Dmaven.site.deploy.skip=true -Dresume=false -DautoVersionSubmodules=true -DdryRun=false -Djsse.enableSNIExtension=false -Dmaven.test.skip=true -DreleaseVersion=1.0.0 -DdevelopmentVersion=1.0.1 -DskipITs -DscmCommentPrefix="[ci skip]" release:prepare release:perform
      when: manual
      only:
      - master
  </code></pre>
  
  <p>I tried to run this job, it is able to deploy, tag version but it is not able to change pom.xml version to next iteration due to below error,</p>
  
  <pre><code>    [INFO] Checking in modified POMs...
      [INFO] commit done: [ci skip]prepare release REL_xxxxx
      [INFO] push changes to remote... refs/heads/master:refs/heads/master
      [INFO] fetch url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] push url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] REJECTED_OTHER_REASON - RemoteRefUpdate[remoteName=refs/heads/master, REJECTED_OTHER_REASON, (null)...xx3xxx9c7cdc6dxx, fastForward, srcRef=refs/heads/master, message="pre-receive hook declined"]
      [INFO] Tagging release with the label REL_xxxxx...
      [INFO] push tag [REL_xxxxxx] to remote...
      [INFO] fetch url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] push url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] OK - RemoteRefUpdate[remoteName=refs/tags/REL_xxxxx, OK, (null)...c5ce4d1fdf5f0a9415d9f02a48aab4f536eab52c, fastForward, srcRef=refs/tags/REL_xxxxx, message=null]
      [INFO] Transforming 'project name'...
      [INFO] Transforming 'Rproject'...
      [INFO] Transforming 'project'...
      [INFO]   Updating project name to xxx-SNAPSHOT
      [INFO] Not removing release POMs
      [INFO] Checking in modified POMs...
      [INFO] commit done: [ci skip]prepare for next development iteration
      [INFO] push changes to remote... refs/heads/master:refs/heads/master
      [INFO] fetch url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] push url: https:/usrname:password@gitlabt.com/test/project/projectname.git
      [INFO] REJECTED_OTHER_REASON - RemoteRefUpdate[remoteName=refs/heads/master, REJECTED_OTHER_REASON, (null)...1xxxxx541baf208dxxxd, fastForward, srcRef=refs/heads/master, message="pre-receive hook declined"]
      [INFO] Release preparation complete.
      [INFO] 
      [INFO] --- maven-release-plugin:2.5.1:perform (default-cli) @ mobile-interface-parent ---
  </code></pre>