Fail builds if multiple main classes are found

Update the maven and gradle plugins to fail the build if a single
unique main class cannot be found. Additionally plugins will warn
if the search is taking too long.

Fixes gh-210