get default maven version from distribution file name

Also this patch fixes an error when in the dist folder
are multiple files

Change-Id: I56438e09c0817f010bf86f9aa49e3d0c7f8039ec
(cherry picked from commit 6bc4372cc73a1155fd8dcd919571aed2f54daef5)