String (@NotNull String multiModuleProjectDirectory) { var dir = multiModuleProjectDirectory; if (dir.isBlank()) { MavenLog.LOG.warn("Maven project directory is blank. Using project base path"); dir = myProject.getBasePath(); } if (null == dir || dir.isBlank()) { MavenLog.LOG.warn("Maven project directory is blank. Using tmp dir"); dir = System.getProperty("java.io.tmpdir"); } Path path = Path.of(dir).toAbsolutePath(); while (null != path && !Files.exists(path)) { MavenLog.LOG.warn(String.format("Maven project %s directory does not exist. Using parent", path)); path = path.getParent(); } if (null == path) { throw new RuntimeException("Could not determine maven project directory: " + multiModuleProjectDirectory); } return path.toString(); }