热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

groovy.grape.Grape.grab()方法的使用及代码示例

本文整理了Java中groovy.grape.Grape.grab()方法的一些代码示例,展示了Grape.grab()的具体用法。这些代码示

本文整理了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()]));

推荐阅读
author-avatar
雪儿babyqueenpb_446
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有