Builder builder = ModuleSpec.build(id);
builder.addResourceRoot(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createJarResourceLoader(
"name-of-jar", new JarFile(new File("path to jar")))));
builder.addDependency(DependencySpec.createLocalDependencySpec()); // adds the classes from this module itself
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.forge")));
return builder.create();
}
catch (IOException e) {
throw new ModuleLoadException("Failed to load module", e);
}
}