Esempio n. 1
0
  /**
   * Generates a pom.xml file
   *
   * @param dir
   * @param pom
   * @param artifact
   */
  protected void generatePom(File dir, Pom pom, String artifact) {
    if (generatePom) {
      // output pom file
      getConsole().debug("generating pom");
      File pomFile = new File(dir, artifact + ".pom");
      FileUtils.writeContent(pomFile, pom.toXML(false));
      getConsole().debug(1, "wrote {0}", pomFile);

      // add pom file to installed artifacts path
      reference(pomFile);
    }
  }
Esempio n. 2
0
  /**
   * Install release artifacts to the artifact directory.
   *
   * @param pom
   * @param sourceDir
   * @param artifactDir
   * @param optionally update metadata
   */
  protected void deployRelease(Pom pom, File sourceDir, File artifactDir, boolean updateMetadata) {
    String artifact = pom.artifactId + "-" + pom.version;
    String pattern = artifact + "*";
    Dependency asDependency = new Dependency(pom.getCoordinates());

    // copy artifacts
    copy(sourceDir, pattern, artifactDir);

    // output pom file
    generatePom(artifactDir, pom, artifact);

    // calculate checksums for each file
    calculateChecksums(artifactDir, pattern);

    // optionally update metadata
    if (updateMetadata) {
      updateArtifactsMetadata(artifactDir, asDependency);
    }
  }