private String findMainClass(SourceSet main) { if (main == null) { return null; } getLogger().info("Looking for main in: " + main.getOutput().getClassesDir()); try { return MainClassFinder.findMainClass(main.getOutput().getClassesDir()); } catch (IOException ex) { throw new IllegalStateException("Cannot find main class", ex); } }