Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract license information from pom.xml for sourcearchive #1234

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

yashkohli88
Copy link
Contributor

@yashkohli88 yashkohli88 commented Nov 15, 2024

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.
  1. 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 -

  • Investigated how is maven computing its license for the multiple pom cases, and checked different components for the scnearios.
  • Tested multi license pom files to check complex license expression getting generated.
  • Added integration test for the two scenarios - 1) Where the manifest section is present, 2) The manifest section is not present in order to check if our existing code is able to handle even when the manifest section is not present(Backward compatibility)

**Future Scope -

  • Yash to add another issue to track, few missing licenses in the _licenseUrlOverrides list which sets declared license as NOASSERTION even when the license is identified correctly. Below test cases will be fixed after fixing this issue -
  • com.sun.xml.bind/jaxb-impl/2.3.5 (Same as Maven: NOASSERTION, as both licenses are absent in the list, resulting in NOASSERTION)
  • ch.qos.logback/logback-classic/1.5.11 (Will be updated in future scope)
  • org.javassist/javassist/3.30.2-GA - MPL license not detected

#1246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants