Changes to distance measure implementation

Some changes to pom to facilitate building in jdk 6