Class 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 Detail

      • AllPackageBuilder

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

      • autoDependenciesMode

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

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

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

        public AllPackageBuilder logger​(org.apache.maven.plugin.logging.Log value)
        Parameters:
        value - Maven logger
        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()
      • getPackageName

        public String getPackageName()
      • getTargetFile

        public File getTargetFile()