作者:雪儿babyqueenpb_446 | 来源:互联网 | 2023-10-12 20:42
本文整理了Java中groovy.grape.Grape.grab()
方法的一些代码示例,展示了Grape.grab()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Grape.grab()
方法的具体详情如下:
包路径:groovy.grape.Grape
类名称:Grape
方法名:grab
Grape.grab介绍
暂无
代码示例
代码示例来源:origin: org.codehaus.groovy/groovy
Grape.grab(basicArgs, grabMaps.toArray(new Map[0]));
代码示例来源:origin: org.apache.camel/camel-catalog-maven
@Override
public boolean loadVersion(String version) {
try {
URLHandlerRegistry.setDefault(httpClient);
if (cacheDirectory != null) {
System.setProperty("grape.root", cacheDirectory);
}
Grape.setEnableAutoDownload(true);
Map param = new HashMap<>();
param.put("classLoader", classLoader);
param.put("group", "org.apache.camel");
param.put("module", "camel-catalog");
param.put("version", version);
Grape.grab(param);
this.version = version;
return true;
} catch (Exception e) {
if (log) {
System.out.print("WARN: Cannot load version " + version + " due " + e.getMessage());
}
return false;
}
}
代码示例来源:origin: org.apache.camel/camel-catalog-maven
@Override
public boolean loadRuntimeProviderVersion(String groupId, String artifactId, String version) {
try {
URLHandlerRegistry.setDefault(httpClient);
Grape.setEnableAutoDownload(true);
Map param = new HashMap<>();
param.put("classLoader", classLoader);
param.put("group", groupId);
param.put("module", artifactId);
param.put("version", version);
Grape.grab(param);
this.runtimeProviderVersion = version;
return true;
} catch (Exception e) {
if (log) {
System.out.print("WARN: Cannot load runtime provider version " + version + " due " + e.getMessage());
}
return false;
}
}
代码示例来源:origin: org.apache.camel/camel-catalog-maven
System.out.println("Downloading " + groupId + ":" + artifactId + ":" + version);
Grape.grab(param);
代码示例来源:origin: com.tinkerpop/gremlin-groovy
/**
* {@inheritDoc}
*
* This method should be called after "expected" imports have been added to the {@code DependencyManager}
* because adding imports with {@link #addImports(java.util.Set)} will reset the classloader and flush away
* dependencies.
*/
@Override
public synchronized List use(final String group, final String artifact, final String version) {
final Map dependency = new HashMap() {{
put("group", group);
put("module", artifact);
put("version", version);
}};
final Map args = new HashMap() {{
put("classLoader", loader);
}};
Grape.grab(args, dependency);
// note that the service loader utilized the classloader from the groovy shell as shell class are available
// from within there given loading through Grape.
final List pluginsFound = new ArrayList<>();
ServiceLoader.load(GremlinPlugin.class, loader).forEach(pluginsFound::add);
artifactsToUse.add(new Artifact(group, artifact, version));
return pluginsFound;
}
代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm
Grape.grab(basicArgs, grabMaps.toArray(new Map[grabMaps.size()]));
代码示例来源:origin: org.kohsuke.droovy/groovy
Grape.grab(basicArgs, grabMaps.toArray(new Map[grabMaps.size()]));
} catch (RuntimeException re) {
代码示例来源:origin: org.codehaus.groovy/groovy-jdk14
Grape.grab(basicArgs, grabMaps.toArray(new Map[grabMaps.size()]));