Package org.moxie

Examples of org.moxie.IMavenCache


      });
      if (poms == null || poms.length == 0) {
        return null;
      }
      File pomFile = poms[0];
      IMavenCache cache = config.getMoxieCache();
      return PomReader.readPom(cache, pomFile);
    }
    return null;
  }
View Full Code Here


      repositories.add(repository);
    }
   
    // create/update the prefix indexes for the repositories
    for (String repository : repositories) {
      IMavenCache cache = config.getMavenCache(repository);
      cache.updatePrefixesIndex();
    }
  }
View Full Code Here

          logger.severe(MessageFormat.format(msg, repository));
        }
      }

      // create/update the prefix indexes for the repositories
      IMavenCache cache = config.getMavenCache(repository);
      cache.updatePrefixesIndex();
    } catch (Throwable t) {
      logger.log(Level.SEVERE, MessageFormat.format("Lucene indexing failure for {0}", repository), t);
    }
  }
View Full Code Here

    if (!deleteIndex(repository)) {
      return result;
    }
    try {
      MoxieCache moxieCache = config.getMoxieCache();
      IMavenCache repositoryCache = config.getMavenCache(repository);
      Collection<File> files = repositoryCache.getFiles("." + org.moxie.Constants.POM);
      IndexWriter writer = getIndexWriter(repository);

      for (File pomFile : files) {
        try {
          Pom pom = PomReader.readPom(moxieCache, pomFile);
View Full Code Here

   * @return pomFile
   */
  private void incrementalIndex(File pomFile) {
    try {
      String repository = config.getRepositoryId(pomFile);
      IMavenCache cache = config.getMavenCache(repository);
      Pom pom = PomReader.readPom(cache, pomFile);
     
      delete(repository, pom);
     
      IndexWriter writer = getIndexWriter(repository);
View Full Code Here

  public DependencyLink find(Dependency dependency) {
    String path = null;
    for (String repository : localRepositories) {
      File cacheRoot = new File(localArtifactsRoot, repository);
      IMavenCache cache = new MavenCache(cacheRoot);
      File file = cache.getArtifact(dependency, dependency.extension);
      if (file != null && file.exists()) {       
        path = repository + "/" + FileUtils.getRelativePath(cacheRoot, file.getParentFile());
      }
    }
   
    for (RemoteRepository repository : remoteRepositories) {
      String folder = StringUtils.urlToFolder(repository.url);
      File cacheRoot = new File(remoteArtifactsRoot, folder);
      IMavenCache cache = new MavenCache(cacheRoot);
      File file = cache.getArtifact(dependency, dependency.extension);
      if (file != null && file.exists()) {
        path = repository.id + "/" + FileUtils.getRelativePath(cacheRoot, file.getParentFile());
      }
    }
    if (StringUtils.isEmpty(path)) {
View Full Code Here

    return remoteRepositories;
  }
 
  public String getRepositorySize(String repository) {
    if (!repositorySizeCache.containsKey(repository)) {
      IMavenCache cache = getMavenCache(repository);
      File folder = cache.getRootFolder();
      long size = FileUtils.folderSize(folder);
      String value = FileUtils.formatSize(size);
      repositorySizeCache.put(repository, value);
    }
    return repositorySizeCache.get(repository);
View Full Code Here

      // do not deploy snapshots into the repository
      return;
    }
   
    Dependency asDependency = new Dependency(pom.getCoordinates());
    IMavenCache artifactCache = getArtifactCache(pom.isSnapshot());
    File cacheRoot = artifactCache.getRootFolder();
    File artifactFile = artifactCache.getArtifact(asDependency, asDependency.extension);
    File artifactDir = artifactFile.getParentFile();
    File sourceDir = build.getConfig().getTargetDirectory();
   
    titleClass(pom.artifactId + "-" + pom.version);

    if (asDependency.isSnapshot()) {
      deploySnapshot(pom, sourceDir, artifactDir, artifactCache);
    } else {
      deployRelease(pom, sourceDir, artifactDir, true);
    }
   
    // updates the prefixes index
    artifactCache.updatePrefixesIndex();

    if (generateIndexPage) {
      boolean extracted = extractResource(cacheRoot, "maven/index.html", "index.html", false);     
      extractResource(cacheRoot, "maven/favicon.png", "favicon.png", false);
     
      if (extracted) {
        // create JSON repository metadata
        String template = readResourceAsString("maven/repository.json").trim();
        template = getProject().replaceProperties(template);
        FileUtils.writeContent(new File(cacheRoot, "repository.json"), template);
      }
     
      // create/update JSON artifact index
      String template = readResourceAsString("maven/artifact.json").trim();
      StringBuilder sb = new StringBuilder("[\n\n");
      String index = artifactCache.generatePomIndex(template, ",\n");
      sb.append(index);
      sb.append("\n]\n");
      FileUtils.writeContent(new File(cacheRoot, "artifacts.json"), sb.toString());
    }   
  }
View Full Code Here

    installedArtifacts = new Path(getProject());
    getProject().addReference(id, installedArtifacts);
  }
 
  protected IMavenCache getArtifactCache(boolean isSnapshot) {
    IMavenCache cache;
    if (baseDir == null) {
      if (StringUtils.isEmpty(repositoryId)) {
        // return MoxieCache
        cache = getBuild().getSolver().getMoxieCache();
      } else {
View Full Code Here

      // do not install snapshots into the repository
      return;
    }
   
    Dependency asDependency = new Dependency(pom.getCoordinates());
    IMavenCache cache = getArtifactCache(pom.isSnapshot());
    File artifactFile = cache.getArtifact(asDependency, asDependency.extension);
    File artifactDir = artifactFile.getParentFile();
    File sourceDir = build.getConfig().getTargetDirectory();
   
    titleClass(pom.artifactId + "-" + pom.version);
View Full Code Here

TOP

Related Classes of org.moxie.IMavenCache

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.