Class LicenseClassifier

java.lang.Object
org.codehaus.mojo.license.download.LicenseClassifier

public class LicenseClassifier extends Object
Sorts license names into the categories a reader of a license report cares about: the ones that were signed off, the ones that need a second look, the ones that must not appear at all, and everything nobody has classified yet.

Names are matched ignoring case and surrounding whitespace. Use licenseMerges to bring the spelling variants of one license together before they reach this point.

Since:
2.8.0
  • Constructor Details

  • Method Details

    • isEmpty

      public boolean isEmpty()
      Whether any license was classified at all. A classifier without a single configured name leaves every license LicenseClassifier.LicenseMatch.unknown, so callers can skip the work entirely.
      Returns:
      whether at least one license name is configured
    • classify

      Classifies a single license.
      Parameters:
      license - the license, may be null
      Returns:
      the category the license falls into, never null
    • classify

      Classifies a dependency by the most worrying of its licenses, so that a dependency offering both a forbidden and an approved license is not filed away as approved.
      Parameters:
      info - the dependency
      Returns:
      the category the dependency falls into, never null