There is a time in your project when you start using Gerrit code review system. When you have maven release plugin to make release, you can be very surprised when you see:
[ERROR] The git-push command failed.
This is a situation when we use ssh connections to gerrit. But, when you try to push something to master (ignoring code review), it works! How is that possible?
You probably have in your gitconfig an ssh URL with your user name. But in your project SCM (in pom.xml) you do not have your user name. What user name maven release plugin use? Your computer account name, which is in most cases different than your Gerrit user name.
How to repair it? Define a file in .ssh/config directory with content:
There may be a lot of other reason why you have
Premission denied, but this was the hardest I’ve ever seen.