BuildDependenciesCommunityRoot (Class<?> klass) { final Path start = getSomeRoot(klass); Path home = start; while (home != null) { if (Files.exists(home.resolve(COMMUNITY_REPO_MARKER_FILE))) { return new BuildDependenciesCommunityRoot(home); } if (Files.exists(home.resolve("community").resolve(COMMUNITY_REPO_MARKER_FILE))) { return new BuildDependenciesCommunityRoot(home.resolve("community")); } // Handle Rider layout case if (Files.exists(home.resolve("ultimate").resolve("community").resolve(COMMUNITY_REPO_MARKER_FILE))) { return new BuildDependenciesCommunityRoot(home.resolve("ultimate").resolve("community")); } home = home.getParent(); } throw new IllegalArgumentException("Cannot guess community project home from root '" + start + "'" + ", marker file '" + COMMUNITY_REPO_MARKER_FILE + "'"); }