Path (File localRepository, String groupId, String artifactId, String version, String type) { Path dir = null; if (StringUtil.isEmpty(groupId)) { for (String each : DEFAULT_GROUPS) { dir = getArtifactDirectory(localRepository, each, artifactId); if (Files.exists(dir)) break; } } else { dir = getArtifactDirectory(localRepository, groupId, artifactId); } version = sanitizeFileName(version); if (StringUtil.isEmpty(version)) version = resolveVersion(dir); return dir.resolve(version).resolve(artifactId + "-" + version + "." + type); }