core/src/main/java/io/fabric8/maven/core/util/ClassUtil.java
public static List<String> findMainClasses(File rootDir) throws IOException {
        List<String> ret = new ArrayList<>();
        if (!rootDir.exists()) {
            return ret;
        }
        if (!rootDir.isDirectory()) {
            throw new IllegalArgumentException(String.format("Path %s is not a directory",rootDir.getPath()));
        }
        findClasses(ret, rootDir, rootDir.getAbsolutePath() + "/");
        return ret;
    }
public static List<String> findMainClasses(File rootDir) throws IOException {
        List<String> ret = new ArrayList<>();
        if (!rootDir.exists()) {
            return ret;
        }
        if (!rootDir.isDirectory()) {
            throw new IllegalArgumentException(String.format("Path %s is not a directory",rootDir.getPath()));
        }
        findClasses(ret, rootDir, rootDir.getAbsolutePath() + "/");
        return ret;
    }
public static List < String > findMainClasses ( File rootDir ) throws IOException { List < String > ret = new ArrayList <> ( ) ; if ( ! rootDir . exists ( ) ) { return ret ; } if ( ! rootDir . isDirectory ( ) ) { throw new IllegalArgumentException ( String . format ( "Path %s is not a directory" , rootDir . getPath ( ) ) ) ; } findClasses ( ret , rootDir , rootDir . getAbsolutePath ( ) + "/" ) ; return ret ; }
Find all classes below a certain directory which contain
main() classes

@param rootDir the directory to start from
@return List of classes with "public void static main(String[] args)" methods. Can be empty, but not null.
@exception IOException if something goes wrong
Find all classes below a certain directory which contain main () classes