Class AggregateLicensePolicyEnforcer


  • public class AggregateLicensePolicyEnforcer
    extends Object
    Aggregate license policy enforcement with default enforcer bindings based on LicensePolicy.Type.

    Rules are applied in the following order: 1) defaultPolicy: unless overridden via setDefaultPolicy, this will DENY all artifacts. 2) APPROVE policies: any policy in the Set which have LicensePolicy.Rule.APPROVE 3) DENY policies: any policy in the Set which have LIcensePolicy.Rule.DENY

    • Constructor Detail

      • AggregateLicensePolicyEnforcer

        public AggregateLicensePolicyEnforcer​(Set<LicensePolicy> policies)
    • Method Detail

      • apply

        public Map<org.apache.maven.artifact.Artifact,​LicensePolicyEnforcerResult> apply​(Map<org.apache.maven.model.License,​Set<org.apache.maven.artifact.Artifact>> licenseMap)
        Take a map of License keys and the Set of Artifact attributed to them, applying the internal set of LicensePolicyEnforcer implementations on them, and returning a mapping of Artifact keys to the boolean enforcement decision made.
        Parameters:
        licenseMap - - the underlying LicenseMap interface types
        Returns:
        final policy decision map on each artifact
      • apply

        public Map<org.apache.maven.artifact.Artifact,​LicensePolicyEnforcerResult> apply​(LicenseMap licenseMap)
        Take an LicenseMap implementation, getting its licenseMap and applying the internal set of LicensePolicyEnforcer implementations on them, and returning a mapping of Artifact keys to the boolean enforcement decision made.
        Returns:
        final policy decision map on each artifact