Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 3.32 KB

File metadata and controls

74 lines (55 loc) · 3.32 KB

Design

Overall Design

LicenseScout is implemented as a Maven plugin. It scans a given base directory for artifacts.

Processing phases

Initialisation

Initialisation includes:

  • Validity checks on the input parameters

  • Creation of output directory, if necessary

  • Reading of configuration files (licenses, mappings, filters, etc)

Scan/license detection

The configured base directory is scanned recursively, either for Java archives or for NPM packages. The archives found are collected in a list. If license information associated with an archive is found, the license is added to the list associated with the archive. During this step a mapping of license URLs to license names is done (so that licenses given as URL can be found from the internal list).

License processing

Processings are done:

  • Manually checked licenses for specific archives are added to the archives from the checked archives list.

  • a license status for each archive is calculated.

  • Global filters are applied: artifact names are matched against a global filter that applies regular expressions on the artifact path name. Artifacts that match are removed.

  • The vendor filter is applied, using the configured vendor names to filter out: artifacts with a certain vendor name in the MANIFEST.MF are removed (this can be used for own artifacts, which should not appear at all).

  • Clean output filtering is applied, if configured

  • Statistics on the total number of archives, the total number of considered license files and the number of archives per license state are calculated.

Report Output

From the collected, processed and filtered information reports are generated, depending on the output configuration. Either a HTML report, a CSV report, a TXT report, or a combination of these are generated. The CSV Output is suitable for automatic comparison between versions. The HTML output uses velocity templates to generate the output. The template used for this is org.aposin.licensescout/src/main/resources/templates/license_report.vm. The TXT output uses hard-coded text fragments.

Database Output

If configured, important data are also written to a database.

The results are written into three tables:

  • Builds

  • LibraryData

  • DetectedLicenses

Note
For details on the table structure see the files:
  • licensescout-core/sql/licensescout-mysql.sql

  • licensescout-core/sql/licensescout-h2.sql

  • licensescout-core/sql/licensescout-hsqldb.sql