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
Code Update: The service repo has been updated to consume manifest data and extract license information from manifest.summary.licenses.
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.
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:
org.javassist/javassist/3.30.2-GA (Two out of three licenses are identified correctly. The third license is MPL and will be addressed in future updates)
javax.servlet/javax.servlet-api/4.0.1 (Improvement observed due to scancode findings. Note that ClearlyDefined license is NOASSERTION as the license expression from POM is not standard)
Tasks completed -
[x] Investigated how is maven computing its license for the multiple pom cases, and checked different components for the scnearios.
[x] Tested multi license pom files to check complex license expression getting generated.
[x] 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)
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
manifest.summary.licenses
.addMavenData
function, now also reused inaddSourceArchive
.getDeclaredLicenseMaven
, which abstracts the license extraction logic, making it reusable for bothaddMavenData
andaddSourceArchiveData
.getDeclaredLicenseMaven
correctly identifies and returns all licenses when provided with the data.Test Cases Overview
The following scenarios have been tested and documented:
Tasks completed -
**Future Scope -