}
private static Path getDependencyPath(Object dependencyManager, String p) {
if (dependencyManager == null)
throw new RuntimeException("No dependencies specified in the capsule. Cannot resolve dependency " + p);
final DependencyManager dm = (DependencyManager) dependencyManager;
List<Path> depsJars = dm.resolveDependency(p, "jar");
if (depsJars == null || depsJars.isEmpty())
throw new RuntimeException("Dependency " + p + " was not found.");
return depsJars.iterator().next().toAbsolutePath();
}