From 9b93db7e101a6f191a5a63f468de1000204e15e9 Mon Sep 17 00:00:00 2001 From: Stanislav Ochotnicky Date: Thu, 18 Oct 2012 09:40:36 +0200 Subject: [PATCH] Add looking into maven.repo.local before other places We want to look into .m2 cache just in case we already have an artifact there. This can help with fixing builds and testing new things. It also fixes problems encountered by few projects that require themselves --- JavadirWorkspaceReader.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/JavadirWorkspaceReader.java b/JavadirWorkspaceReader.java index d231e7d..35e9368 100644 --- a/JavadirWorkspaceReader.java +++ b/JavadirWorkspaceReader.java @@ -56,6 +56,19 @@ public class JavadirWorkspaceReader implements WorkspaceReader { String version = artifact.getVersion(); String wantedVersion = new String(version); + // let's check out local repo first + String m2_path = System.getProperty("maven.repo.local"); + String gid_path = groupId.replace(".", File.separator); + String art_path = m2_path + File.separator + gid_path + File.separator + artifactId + + File.separator + version + File.separator + artifactId + "-" + + version + "." + artifact.getExtension(); + + ret = new File(art_path); + if (ret.isFile()) { + MavenJPackageDepmap.debug("Returning " + art_path.toString()); + return ret; + } + MavenJPackageDepmap.debug("Wanted GROUPID=" + groupId); MavenJPackageDepmap.debug("Wanted ARTIFACTID=" + artifactId); MavenJPackageDepmap.debug("Wanted VERSION=" + version);