clearlydefined / service

The service side of clearlydefined.io
MIT License
45 stars 41 forks source link

Extract license information from pom.xml for sourcearchive #1234

Open yashkohli88 opened 6 days ago

yashkohli88 commented 6 days ago

Description

This PR addresses the service side of the issue documented at ClearlyDefined Issue #585. The update focuses on enhancing the ClearlyDefined service to extract license information from pom.xml files for source archives.

Changes Made

  1. Code Update: The service repo has been updated to consume manifest data and extract license information from manifest.summary.licenses.
  2. Code Refactoring:
    • Refactored the existing logic to reuse the code for setting declared licenses, initially from the addMavenData function, now also reused in addSourceArchive.
    • Introduced a new function getDeclaredLicenseMaven, which abstracts the license extraction logic, making it reusable for both addMavenData and addSourceArchiveData.
  3. Testing:
    • Added test cases to validate scenarios:
    • Declared license extraction from manifest information.
    • Validation that getDeclaredLicenseMaven correctly identifies and returns all licenses when provided with the data.
    • Validated and added test case for the backward compatibility

Test Cases Overview

The following scenarios have been tested and documented:

  1. Improved License Identification:

Tasks completed -

**Future Scope -