/** * Downloads the plugin via its maven GAV information. This will first look in the local * .m2 directory. If the plugin is not found there, then it will try to download the * plugin from one of the configured remote maven repositories. */ protected void downloadPlugin(File pluginFile, PluginCoordinates coordinates) { // First check the .m2 directory File m2Dir = PluginUtils.getUserM2Repository(); if (m2Dir != null) { File artifactFile = PluginUtils.getM2Path(m2Dir, coordinates); if (artifactFile.isFile()) { try { FileUtils.copyFile(artifactFile, pluginFile); return; } catch (IOException e) { artifactFile.delete(); throw new RuntimeException(e); } } } // Didn't find it in .m2, so try downloading it. Set<URI> repositories = getMavenRepositories(); for (URI mavenRepoUrl : repositories) { if (downloadFromMavenRepo(pluginFile, coordinates, mavenRepoUrl)) { return; } } }
File m2Dir = PluginUtils.getUserM2Repository(); if (m2Dir != null) { File artifactFile = PluginUtils.getM2Path(m2Dir, coordinates);
File m2Dir = PluginUtils.getUserM2Repository(); if (m2Dir != null) { File artifactFile = PluginUtils.getM2Path(m2Dir, coordinates);