Move maven detection logic outside of core