public File[] get(String bsn, String range) throws Exception { File f = get(bsn, range, Strategy.HIGHEST, null); if (f == null) return null; return new File[] { f }; }
public File get(String bsn, String version, Strategy strategy, Map<String, String> properties) throws Exception { String groupId = null; if (properties != null) groupId = properties.get("groupId"); if (groupId == null) { int n = bsn.indexOf('+'); if (n < 0) return null; groupId = bsn.substring(0, n); bsn = bsn.substring(n + 1); } String artifactId = bsn; if (version == null) { if (reporter != null) reporter.error("Maven dependency version not set for %s - %s", groupId, artifactId); return null; } CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories); String value = properties == null ? null : properties.get("scope"); if (value == null) return pom.getArtifact(); Pom.Scope action = null; try { action = Pom.Scope.valueOf(value); return pom.getLibrary(action, repositories); } catch (Exception e) { return pom.getArtifact(); } }
if (location.equals("maven")) { System.out.println("Maven"); MavenRemoteRepository maven = new MavenRemoteRepository(); maven.setProperties(new HashMap<String, String>()); maven.setReporter(this); repos = Arrays.asList((RepositoryPlugin) maven); } else {
public File get(String bsn, String version, Strategy strategy, Map<String,String> properties) throws Exception { String groupId = null; if (properties != null) groupId = properties.get("groupId"); if (groupId == null) { int n = bsn.indexOf('+'); if (n < 0) return null; groupId = bsn.substring(0, n); bsn = bsn.substring(n + 1); } String artifactId = bsn; if (version == null) { if (reporter != null) reporter.error("Maven dependency version not set for %s - %s", groupId, artifactId); return null; } CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories); String value = properties == null ? null : properties.get("scope"); if (value == null) return pom.getArtifact(); Pom.Scope action = null; try { action = Pom.Scope.valueOf(value); return pom.getLibrary(action, repositories); } catch (Exception e) { return pom.getArtifact(); } }
MavenRemoteRepository maven = new MavenRemoteRepository(); maven.setProperties(new Attrs()); maven.setReporter(bnd); repos.add(maven);
@Override public File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { File f = get(bsn, version.toString(), Strategy.EXACT, properties); if (f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { reporter.exception(e, "Download listener for %s", f); } } return f; }
public File get(String bsn, String version, Strategy strategy, Map<String,String> properties) throws Exception { String groupId = null; if (properties != null) groupId = properties.get("groupId"); if (groupId == null) { int n = bsn.indexOf('+'); if (n < 0) return null; groupId = bsn.substring(0, n); bsn = bsn.substring(n + 1); } String artifactId = bsn; if (version == null) { if (reporter != null) reporter.error("Maven dependency version not set for %s - %s", groupId, artifactId); return null; } CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories); String value = properties == null ? null : properties.get("scope"); if (value == null) return pom.getArtifact(); Pom.Scope action = null; try { action = Pom.Scope.valueOf(value); return pom.getLibrary(action, repositories); } catch (Exception e) { return pom.getArtifact(); } }
public File get(String bsn, Version version, Map<String,String> properties, DownloadListener ... listeners) throws Exception { File f= get(bsn, version.toString(), Strategy.EXACT, properties); if ( f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { reporter.exception(e, "Download listener for %s", f); } } return f; }
public File get(String bsn, String version, Strategy strategy, Map<String,String> properties) throws Exception { String groupId = null; if (properties != null) groupId = properties.get("groupId"); if (groupId == null) { int n = bsn.indexOf('+'); if (n < 0) return null; groupId = bsn.substring(0, n); bsn = bsn.substring(n + 1); } String artifactId = bsn; if (version == null) { if (reporter != null) reporter.error("Maven dependency version not set for %s - %s", groupId, artifactId); return null; } CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories); String value = properties == null ? null : properties.get("scope"); if (value == null) return pom.getArtifact(); Pom.Scope action = null; try { action = Pom.Scope.valueOf(value); return pom.getLibrary(action, repositories); } catch (Exception e) { return pom.getArtifact(); } }
public File get(String bsn, Version version, Map<String,String> properties, DownloadListener ... listeners) throws Exception { File f= get(bsn, version.toString(), Strategy.EXACT, properties); if ( f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { reporter.exception(e, "Download listener for %s", f); } } return f; }
public File get(String bsn, String version, Strategy strategy, Map<String, String> properties) throws Exception { String groupId = null; if (properties != null) groupId = properties.get("groupId"); if (groupId == null) { int n = bsn.indexOf('+'); if (n < 0) return null; groupId = bsn.substring(0, n); bsn = bsn.substring(n + 1); } String artifactId = bsn; if (version == null) { if (reporter != null) reporter.error("Maven dependency version not set for %s - %s", groupId, artifactId); return null; } CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories); String value = properties == null ? null : properties.get("scope"); if (value == null) return pom.getArtifact(); Pom.Scope action = null; try { action = Pom.Scope.valueOf(value); return pom.getLibrary(action, repositories); } catch (Exception e) { return pom.getArtifact(); } }
public File get(String bsn, Version version, Map<String,String> properties, DownloadListener ... listeners) throws Exception { File f= get(bsn, version.toString(), Strategy.EXACT, properties); if ( f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { reporter.exception(e, "Download listener for %s", f); } } return f; }
CachedPom pom = getMaven().getPom(groupId, artifactId, version, repositories);
@Override public File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { File f = get(bsn, version.toString(), Strategy.EXACT, properties); if (f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { reporter.exception(e, "Download listener for %s", f); } } return f; }