Just one problem with it - it was not calculating next number but showing next number as 0 all the time. Browsing on internet didn't helped much. Finally I was so frustrated so I tried to, how we Latvians say "paskatīties, kas lācītim vēderā" and added magical "-v" to my Ant to enable verbosity. And voila! -
[buildnumber] CLIENT ERROR: The server has not found anything matching the request URI url=https://myserver/nexus/content/repositories/releases/my/core/maven-metadata.xml
[buildnumber] maven-metadata not available: https://myserver/nexus/content/repositories/releases/my/core/maven-metadata.xml
Property "ivy.build.number" has not been set
Maven? What? I thought I was working with Ivy! Tried to remove "m2compatible" mode in ivysettings.xml which is required by Nexus and build failed of course. After some searching on Google I got to this point -https://issues.apache.org/jira/browse/IVY-1334
To cut long story short, just add useMavenMetadata="false" to your ivysettings.xml. Opensource, yeah...