LUCENE-4949: Make the version prefix ("SNAPSHOT") separately configurable to enable Jenkins use its BUILD_ID variable, cleanup code duplication