Class AllPackageBuilder

java.lang.Object
io.wcm.devops.conga.plugins.aem.maven.allpackage.AllPackageBuilder

public final class AllPackageBuilder extends Object
Builds "all" package based on given set of content packages.

General concept:

  • Iterates through all content packages that are generated or collected by CONGA and contained in the model.json
  • Enforces the order defined in CONGA by automatically adding dependencies to all packages reflecting the file order in model.json
  • Because the dependency chain may be different for each runmode (author/publish), each package is added once for each runmode. Internally this separate dependency change for author and publish is optimized to have each package included only once for author+publish, unless it has a different chain of dependencies for both runmodes, in which case it is included separately for each run mode.
  • To avoid conflicts with duplicate packages with different dependency chains the names of packages that are included in different versions for author/publish are changed and a runmode suffix (.author or .publish) is added, and it is put in a corresponding install folder.
  • To avoid problems with nested sub packages, the sub packages are extracted from the packages and treated in the same way as other packages.
  • Constructor Details

    • AllPackageBuilder

      public AllPackageBuilder(File targetFile, String groupName, String packageName)
      Constructor.
      Parameters:
      targetFile - Target file
      groupName - Group name
      packageName - Package name
  • Method Details

    • autoDependenciesMode

      public AllPackageBuilder autoDependenciesMode(AutoDependenciesMode value)
      Automatically generate dependencies between content packages based on file order in CONGA configuration.
      Parameters:
      value - mode
      Returns:
      this
    • runModeOptimization

      public AllPackageBuilder runModeOptimization(RunModeOptimization value)
      Configure run mode optimization.
      Parameters:
      value - mode
      Returns:
      this
    • packageTypeValidation

      public AllPackageBuilder packageTypeValidation(PackageTypeValidation value)
      How to validate package types to be included in "all" package.
      Parameters:
      value - validation
      Returns:
      this
    • packageVersionMode

      public AllPackageBuilder packageVersionMode(PackageVersionMode value)
      How to handle versions of packages and sub-packages inside "all" package.
      Parameters:
      value - mode
      Returns:
      this
    • logger

      public AllPackageBuilder logger(org.apache.maven.plugin.logging.Log value)
      Maven logger
      Parameters:
      value - Maven logger
      Returns:
      this
    • version

      public AllPackageBuilder version(String value)
      Package version
      Parameters:
      value - Package version
      Returns:
      this
    • buildOutputTimestamp

      public AllPackageBuilder buildOutputTimestamp(BuildOutputTimestamp value)
      Build output timestamp
      Parameters:
      value - timestamp
      Returns:
      this
    • add

      public void add(List<InstallableFile> files, Set<String> cloudManagerTarget)
      Add content packages and OSGi bundles to be contained in "all" content package.
      Parameters:
      files - Content packages (invalid will be filtered out) and OSGi bundles
      cloudManagerTarget - Target environments/run modes the packages should be attached to
      Throws:
      IllegalArgumentException - If and invalid package type is detected
    • build

      public boolean build(Map<String,String> properties) throws IOException
      Build "all" content package.
      Parameters:
      properties - Specifies additional properties to be set in the properties.xml file.
      Returns:
      true if "all" package was generated, false if no valid package was found.
      Throws:
      IOException - I/O exception
    • getGroupName

      public String getGroupName()
      Returns:
      Group name
    • getPackageName

      public String getPackageName()
      Returns:
      Package name
    • getTargetFile

      public File getTargetFile()
      Returns:
      Target file