File (String path) { File workingDir = new File(FileUtil.toSystemDependentName(path)); File baseDir = workingDir; File dir = workingDir; while ((dir = dir.getParentFile()) != null) { if (new File(dir, ".mvn").exists()) { baseDir = dir; break; } } try { return baseDir.getCanonicalFile(); } catch (IOException e) { return baseDir.getAbsoluteFile(); } }