Added MAVEN env var to build environment, with checks

bug 1326891

Change-Id: Ia0cbddba970a12c07a6eaf3dab609fd6da7965a7
Merge "Added MAVEN env var to build environment, with checks"