org.apache.ivy.Ivy.getResolutionCacheManager()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.apache.ivy.Ivy.getResolutionCacheManager()方法的一些代码示例,展示了Ivy.getResolutionCacheManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ivy.getResolutionCacheManager()方法的具体详情如下:
包路径:org.apache.ivy.Ivy
类名称:Ivy
方法名:getResolutionCacheManager

Ivy.getResolutionCacheManager介绍

暂无

代码示例

代码示例来源:origin: vipshop/Saturn

private Set<URL> getCachePath(ModuleDescriptor md, String[] confs) throws ParseException, IOException {
  Set<URL> fs = new HashSet<URL>();
  StringBuffer buf = new StringBuffer();
  Collection<ArtifactDownloadReport> all = new LinkedHashSet<ArtifactDownloadReport>();
  ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
  XmlReportParser parser = new XmlReportParser();
  for (int i = 0; i < confs.length; i++) {
    String resolveId = ResolveOptions.getDefaultResolveId(md);
    File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
    parser.parse(report);
    all.addAll(Arrays.asList(parser.getArtifactReports()));
  }
  for (ArtifactDownloadReport artifact : all) {
    if (artifact.getLocalFile() != null) {
      buf.append(artifact.getLocalFile().getCanonicalPath());
      buf.append(File.pathSeparator);
    }
  }
  String[] fs_str = buf.toString().split(File.pathSeparator);
  for (String str : fs_str) {
    File file = new File(str);
    if (file.exists()) {
      fs.add(file.toURI().toURL());
    }
  }
  return fs;
}

代码示例来源:origin: org.apache.ivy/ivy

private File getStylePath(String styleResourceName) throws IOException {
  // style should be a file (and not an url)
  // so we have to copy it from classpath to cache
  ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
  File style = new File(cacheMgr.getResolutionCacheRoot(), styleResourceName);
  FileUtil.copy(XmlReportOutputter.class.getResourceAsStream(styleResourceName), style, null);
  return style;
}

代码示例来源:origin: org.apache.ivy/ivy

private File getReportStylePath() throws IOException {
  if (xslFile != null) {
    return xslFile;
  }
  // style should be a file (and not an url)
  // so we have to copy it from classpath to cache
  ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
  File style = new File(cacheMgr.getResolutionCacheRoot(), "ivy-report.xsl");
  if (!style.exists()) {
    Message.debug("copying ivy-report.xsl to " + style.getAbsolutePath());
    FileUtil.copy(XmlReportOutputter.class.getResourceAsStream("ivy-report.xsl"), style,
      null);
  }
  return style;
}

代码示例来源:origin: org.apache.ivy/ivy

StringBuffer buf = new StringBuffer();
Collection all = new LinkedHashSet();
ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
XmlReportParser parser = new XmlReportParser();
for (int i = 0; i < confs.length; i++) {

代码示例来源:origin: org.apache.ivy/ivy

ResolutionCacheManager cacheMgr = ivy.getResolutionCacheManager();
XmlReportParser parser = new XmlReportParser();
for (int i = 0; i < confs.length; i++) {

代码示例来源:origin: com.google.code.maven-play-plugin.org.playframework/play

System.out.println("~ Clearing cache : " + ivy.getResolutionCacheManager().getResolutionCacheRoot() + ",");
System.out.println("~");
try {
  FileUtils.deleteDirectory(ivy.getResolutionCacheManager().getResolutionCacheRoot());
  System.out.println("~       Clear");
} catch (IOException e) {

代码示例来源:origin: org.apache.ivy/ivy

private void genStyled(String[] confs, File style, String ext) throws IOException {
  ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();

代码示例来源:origin: org.apache.ivy/ivy

private void genxml(String[] confs) throws IOException {
  ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
  for (int i = 0; i < confs.length; i++) {
    File xml = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
    File out;
    if (todir != null) {
      out = new File(todir, getOutputPattern(confs[i], "xml"));
    } else {
      out = getProject().resolveFile(getOutputPattern(confs[i], "xml"));
    }
    FileUtil.copy(xml, out, null);
  }
}

代码示例来源:origin: org.apache.ivy/ivy

private String getOutputPattern(String conf, String ext) {
  if (mRevId == null) {
    ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
    XmlReportParser parser = new XmlReportParser();
    File reportFile = cacheMgr.getConfigurationResolveReportInCache(resolveId, conf);
    try {
      parser.parse(reportFile);
    } catch (ParseException e) {
      throw new BuildException("Error occurred while parsing reportfile '"
          + reportFile.getAbsolutePath() + "'", e);
    }
    // get the resolve module
    mRevId = parser.getResolvedModule();
  }
  return IvyPatternHelper.substitute(outputpattern, mRevId.getOrganisation(),
    mRevId.getName(), mRevId.getRevision(), "", "", ext, conf,
    mRevId.getQualifiedExtraAttributes(), null);
}

代码示例来源:origin: dkpro/dkpro-core

ivy.getResolutionCacheManager().getResolvedIvyFileInCache(moduleId).delete();
ivy.getResolutionCacheManager().getResolvedIvyPropertiesInCache(moduleId).delete();
ivy.getResolutionCacheManager().getConfigurationResolveReportInCache(resid, "default")
    .delete();

代码示例来源:origin: org.apache.ivy/ivy

ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
String resolvedId = getResolveId();
if (resolvedId == null) {

代码示例来源:origin: fizzed/blaze

ivy.getResolutionCacheManager().clean();

代码示例来源:origin: org.apache.ivy/ivy

.setValidate(doValidate(settings)));
ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
new XmlReportOutputter().output(report, cacheMgr, new ResolveOptions());
if (graph) {

代码示例来源:origin: org.apache.ivy/ivy

public void doExecute() throws BuildException {
  prepareAndCheck();
  try {
    ResolutionCacheManager cacheMgr = getIvyInstance().getResolutionCacheManager();
    String[] confs = splitConfs(getConf());
    String resolveId = getResolveId();
    if (resolveId == null) {
      resolveId = ResolveOptions.getDefaultResolveId(getResolvedModuleId());
    }
    XmlReportParser parser = new XmlReportParser();
    for (int i = 0; i < confs.length; i++) {
      File report = cacheMgr.getConfigurationResolveReportInCache(resolveId, confs[i]);
      parser.parse(report);
      Artifact[] artifacts = parser.getArtifacts();
      for (int j = 0; j < artifacts.length; j++) {
        Artifact artifact = artifacts[j];
        String name = IvyPatternHelper.substitute(getSettings().substitute(getName()),
          artifact, confs[i]);
        String value = IvyPatternHelper.substitute(
          getSettings().substitute(getValue()), artifact, confs[i]);
        setProperty(name, value);
      }
    }
  } catch (Exception ex) {
    throw new BuildException("impossible to add artifact properties: " + ex, ex);
  }
}

相关文章