Gerrit and maven release plugin

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:

1
2
3
[ERROR] The git-push command failed.  
[ERROR] Command output:
[ERROR] Permission denied (publickey).

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:

1
2
3
4
Host gerrit  
HostName YOUR_GERRIT_HOST
Port YOUR_GERRIT_PORT
User YOUR_GERRIT_USER_NAME

There may be a lot of other reason why you have Premission denied, but this was the hardest I’ve ever seen.

GNU sed and xpath on OS X

In my team, there is 20% of OS X machines, rest are linuxes. We share one script, that everyone on our team uses.

That script was written by some guy on Ubuntu and guess what? GNU versions of those programs (sed and xpath) are not compatible with BSD versions. The script was failing :(

I was trying to improve the script, but forget about it. Just use GNU programs.

To install gnu sed on osx via homebrew type the following:

GNU Sed
1
brew install gnu-sed --with-default-names

To install gnu xpath on osx via homebrew type the following:

GNU Xpath
1
2
3
4
brew tap concept-not-found/tap  
brew install xpath
mv /usr/local/bin/xpath /usr/local/bin/osx.xpath
sudo ln -s /usr/local/Cellar/xpath/1.13-7/bin/xpath /usr/local/bin/xpath

Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig

This is not a book about motorcycle maintenance. This is not only a book about the zen. This is not only a novel. This is mostly a book about philosophy. But philosophy is served in nice form. 

This book took me to journey though a USA. I was feeling that I was an passenger of this journey. I was feeling that I was traveling with author that talks to me about philosophy. 

During this journey, the idea of quality and value was assembled and dissembled many times, like motorcycle parts. It was mostly presented in straightforward form and readable manner. It has a good points to think about it. But, some parts were misleading for me.

I read this book because I need a change from normal technical book. My score for that book is 4 of 5 points. 

Photo credit