String (Path pluginDir) { List<String> versions = new ArrayList<>(); try (Stream<Path> children = Files.list(pluginDir)) { children.forEach(path -> { if (Files.isDirectory(path)) { versions.add(path.getFileName().toString()); } }); } catch (NoSuchFileException e) { return ""; } catch (Exception e) { MavenLog.LOG.warn(e.getMessage()); return ""; } if (versions.isEmpty()) return ""; Collections.sort(versions); return versions.get(versions.size() - 1); }