public static void main(String[] args) throws Exception { new MavenResolver().initialise(ArrayUtils.join(args, ",")); } }
public static List<RemoteRepository> newRepositories( RepositorySystem system, RepositorySystemSession session ) { return new ArrayList<RemoteRepository>( Arrays.asList( newCentralRepository()) ); }
RepositorySystem system = newRepositorySystem(); RepositorySystemSession session = newRepositorySystemSession(system); List<Artifact> deps = extractMavenCoordinates(coordinates); Collection<File> foundDepFiles = new ArrayList<>(); DependencyFilter df = new DependencyFilter() { final List<RemoteRepository> repos = newRepositories( system, session );
@Override public void initialise() throws Exception { String requestedCoords = ApplicationSetup.getProperty( "terrier.mvn.coords", ApplicationSetup.getProperty("terrier.ivy.coords", null)); if (requestedCoords == null) return; if (requestedCoords.equals(ApplicationSetup.getProperty( "terrier.ivy.coords", null))) { System.err .println("WARNING to CRAIG: stop relying on terrier.ivy.coords"); } // prevent more than one thread initing concurrently synchronized (lock) { if (initCoords != null && initCoords.equals(requestedCoords)) return; this.initialise(requestedCoords); initCoords = requestedCoords; } }
.map(p -> { String[] splits = p.replace("/", ":").split(":"); require(splits.length == 3, "Provided Maven Coordinates must be in the form " + "'groupId:artifactId:version'. The coordinate provided is: " + p); require(splits[0] != null && splits[0].trim().length() > 0, "The groupId cannot be null or " + "be whitespace. The groupId provided is: " + splits[0]); require(splits[1] != null && splits[1].trim().length() > 0, "The artifactId cannot be null or " + "be whitespace. The artifactId provided is: " + splits[1]); require(splits[2] != null && splits[2].trim().length() > 0, "The version cannot be null or " + "be whitespace. The version provided is: "
RepositorySystem system = newRepositorySystem(); RepositorySystemSession session = newRepositorySystemSession(system); List<Artifact> deps = extractMavenCoordinates(coordinates); Collection<File> foundDepFiles = new ArrayList<>(); DependencyFilter df = new DependencyFilter() { final List<RemoteRepository> repos = newRepositories( system, session );
@Override public void initialise() throws Exception { String requestedCoords = ApplicationSetup.getProperty( "terrier.mvn.coords", ApplicationSetup.getProperty("terrier.ivy.coords", null)); if (requestedCoords == null) return; if (requestedCoords.equals(ApplicationSetup.getProperty( "terrier.ivy.coords", null))) { System.err .println("WARNING to CRAIG: stop relying on terrier.ivy.coords"); } // prevent more than one thread initing concurrently synchronized (lock) { if (initCoords != null && initCoords.equals(requestedCoords)) return; this.initialise(requestedCoords); initCoords = requestedCoords; } }
.map(p -> { String[] splits = p.replace("/", ":").split(":"); require(splits.length == 3, "Provided Maven Coordinates must be in the form " + "'groupId:artifactId:version'. The coordinate provided is: " + p); require(splits[0] != null && splits[0].trim().length() > 0, "The groupId cannot be null or " + "be whitespace. The groupId provided is: " + splits[0]); require(splits[1] != null && splits[1].trim().length() > 0, "The artifactId cannot be null or " + "be whitespace. The artifactId provided is: " + splits[1]); require(splits[2] != null && splits[2].trim().length() > 0, "The version cannot be null or " + "be whitespace. The version provided is: "
public static void main(String[] args) throws Exception { new MavenResolver().initialise(ArrayUtils.join(args, ",")); } }
public static List<RemoteRepository> newRepositories( RepositorySystem system, RepositorySystemSession session ) { return new ArrayList<RemoteRepository>( Arrays.asList( newCentralRepository()) ); }
@Test public void testImportSingleDirect() throws Exception { new MavenResolver().initialise("com.harium.database:sqlite:1.0.5"); assertNotNull(Thread.currentThread().getContextClassLoader().loadClass("com.harium.database.sqlite.module.SQLiteDatabaseModule")); //Class.forName("com.harium.database.sqlite.module.SQLiteDatabaseModule"); }
@Test public void testImportSingleIndirectWithClassifier() throws Exception { new MavenResolver().initialise("org.nd4j:nd4j-native-platform:0.8.0,org.nd4j:nd4j-native:0.8.0"); Class<?> clz = Thread.currentThread().getContextClassLoader().loadClass("org.nd4j.linalg.factory.Nd4j"); assertNotNull(clz); Object instance = clz.newInstance(); assertNotNull(instance); }