[BZ-1161577] avoid looking for existing snapshot version in maven repo during compilation

(cherry picked from commit c401160bffc4527e02908b36a17305874ff6eca6)