Fix maven detection script

Change-Id: I50026cef0b4e661b0c134c3bfbf6ae89b8130772