Class AggregateLicensePolicyEnforcer
- java.lang.Object
-
- com.mycila.maven.plugin.license.dependencies.AggregateLicensePolicyEnforcer
-
public class AggregateLicensePolicyEnforcer extends Object
Aggregate license policy enforcement with default enforcer bindings based onLicensePolicy.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.APPROVE3) DENY policies: any policy in the Set which haveLIcensePolicy.Rule.DENY
-
-
Constructor Summary
Constructors Constructor Description AggregateLicensePolicyEnforcer(Set<LicensePolicy> policies)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<org.apache.maven.artifact.Artifact,LicensePolicyEnforcerResult>apply(LicenseMap licenseMap)Take anLicenseMapimplementation, getting its licenseMap and applying the internal set ofLicensePolicyEnforcerimplementations on them, and returning a mapping of Artifact keys to the boolean enforcement decision made.Map<org.apache.maven.artifact.Artifact,LicensePolicyEnforcerResult>apply(Map<org.apache.maven.model.License,Set<org.apache.maven.artifact.Artifact>> licenseMap)Take a map ofLicensekeys and the Set ofArtifactattributed to them, applying the internal set ofLicensePolicyEnforcerimplementations on them, and returning a mapping of Artifact keys to the boolean enforcement decision made.LicensePolicyEnforcer<?>getDefaultPolicy()Set<LicensePolicyEnforcer>getEnforcers()Set<LicensePolicy>getPolicies()voidsetDefaultPolicy(LicensePolicyEnforcer defaultPolicy)voidsetEnforcers(Set<LicensePolicyEnforcer> enforcers)
-
-
-
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 ofLicensekeys and the Set ofArtifactattributed to them, applying the internal set ofLicensePolicyEnforcerimplementations 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 anLicenseMapimplementation, getting its licenseMap and applying the internal set ofLicensePolicyEnforcerimplementations on them, and returning a mapping of Artifact keys to the boolean enforcement decision made.- Returns:
- final policy decision map on each artifact
-
setEnforcers
public void setEnforcers(Set<LicensePolicyEnforcer> enforcers)
-
getEnforcers
public Set<LicensePolicyEnforcer> getEnforcers()
-
getPolicies
public Set<LicensePolicy> getPolicies()
-
getDefaultPolicy
public LicensePolicyEnforcer<?> getDefaultPolicy()
-
setDefaultPolicy
public void setDefaultPolicy(LicensePolicyEnforcer defaultPolicy)
-
-