-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
Fix package resource assign bug for jar manifests #3983
Open
AyanSinhaMahapatra
wants to merge
1
commit into
develop
Choose a base branch
from
jar-manifest-assign-package
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
321 changes: 321 additions & 0 deletions
321
tests/packagedcode/data/maven_misc/assemble/spring-web-5.3.20-jar-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,321 @@ | ||
{ | ||
"packages": [ | ||
{ | ||
"type": "jar", | ||
"namespace": null, | ||
"name": "spring-web", | ||
"version": "5.3.20", | ||
"qualifiers": {}, | ||
"subpath": null, | ||
"primary_language": null, | ||
"description": null, | ||
"release_date": null, | ||
"parties": [], | ||
"keywords": [], | ||
"homepage_url": null, | ||
"download_url": null, | ||
"size": null, | ||
"sha1": null, | ||
"md5": null, | ||
"sha256": null, | ||
"sha512": null, | ||
"bug_tracking_url": null, | ||
"code_view_url": null, | ||
"vcs_url": null, | ||
"copyright": null, | ||
"holder": null, | ||
"declared_license_expression": "apache-2.0", | ||
"declared_license_expression_spdx": "Apache-2.0", | ||
"license_detections": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"matches": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"from_file": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt", | ||
"start_line": 4, | ||
"end_line": 6, | ||
"matcher": "2-aho", | ||
"score": 100.0, | ||
"matched_length": 27, | ||
"match_coverage": 100.0, | ||
"rule_relevance": 100, | ||
"rule_identifier": "apache-2.0_701.RULE", | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_701.RULE" | ||
} | ||
], | ||
"detection_log": [], | ||
"identifier": "apache_2_0-dda7c7b6-8825-2c52-d55b-46f66d469baa" | ||
} | ||
], | ||
"other_license_expression": null, | ||
"other_license_expression_spdx": null, | ||
"other_license_detections": [], | ||
"extracted_license_statement": null, | ||
"notice_text": null, | ||
"source_packages": [], | ||
"is_private": false, | ||
"is_virtual": false, | ||
"extra_data": {}, | ||
"repository_homepage_url": null, | ||
"repository_download_url": null, | ||
"api_data_url": null, | ||
"package_uid": "pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758", | ||
"datafile_paths": [ | ||
"spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/MANIFEST.MF" | ||
], | ||
"datasource_ids": [ | ||
"java_jar_manifest" | ||
], | ||
"purl": "pkg:jar/spring-web@5.3.20" | ||
} | ||
], | ||
"dependencies": [], | ||
"license_detections": [ | ||
{ | ||
"identifier": "apache_2_0-dda7c7b6-8825-2c52-d55b-46f66d469baa", | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"detection_count": 2, | ||
"detection_log": [], | ||
"reference_matches": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"from_file": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt", | ||
"start_line": 4, | ||
"end_line": 6, | ||
"matcher": "2-aho", | ||
"score": 100.0, | ||
"matched_length": 27, | ||
"match_coverage": 100.0, | ||
"rule_relevance": 100, | ||
"rule_identifier": "apache-2.0_701.RULE", | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_701.RULE" | ||
} | ||
] | ||
} | ||
], | ||
"files": [ | ||
{ | ||
"path": "spring-web-5.3.20-jar", | ||
"type": "directory", | ||
"package_data": [], | ||
"for_packages": [], | ||
"detected_license_expression": null, | ||
"detected_license_expression_spdx": null, | ||
"license_detections": [], | ||
"license_clues": [], | ||
"percentage_of_license_text": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "spring-web-5.3.20-jar/spring-web-5.3.20.jar", | ||
"type": "file", | ||
"package_data": [ | ||
{ | ||
"type": "jar", | ||
"namespace": null, | ||
"name": null, | ||
"version": null, | ||
"qualifiers": {}, | ||
"subpath": null, | ||
"primary_language": null, | ||
"description": null, | ||
"release_date": null, | ||
"parties": [], | ||
"keywords": [], | ||
"homepage_url": null, | ||
"download_url": null, | ||
"size": null, | ||
"sha1": null, | ||
"md5": null, | ||
"sha256": null, | ||
"sha512": null, | ||
"bug_tracking_url": null, | ||
"code_view_url": null, | ||
"vcs_url": null, | ||
"copyright": null, | ||
"holder": null, | ||
"declared_license_expression": null, | ||
"declared_license_expression_spdx": null, | ||
"license_detections": [], | ||
"other_license_expression": null, | ||
"other_license_expression_spdx": null, | ||
"other_license_detections": [], | ||
"extracted_license_statement": null, | ||
"notice_text": null, | ||
"source_packages": [], | ||
"file_references": [], | ||
"is_private": false, | ||
"is_virtual": false, | ||
"extra_data": {}, | ||
"dependencies": [], | ||
"repository_homepage_url": null, | ||
"repository_download_url": null, | ||
"api_data_url": null, | ||
"datasource_id": "java_jar", | ||
"purl": null | ||
} | ||
], | ||
"for_packages": [ | ||
"pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758" | ||
], | ||
"detected_license_expression": null, | ||
"detected_license_expression_spdx": null, | ||
"license_detections": [], | ||
"license_clues": [], | ||
"percentage_of_license_text": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract", | ||
"type": "directory", | ||
"package_data": [], | ||
"for_packages": [ | ||
"pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758" | ||
], | ||
"detected_license_expression": null, | ||
"detected_license_expression_spdx": null, | ||
"license_detections": [], | ||
"license_clues": [], | ||
"percentage_of_license_text": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF", | ||
"type": "directory", | ||
"package_data": [], | ||
"for_packages": [ | ||
"pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758" | ||
], | ||
"detected_license_expression": null, | ||
"detected_license_expression_spdx": null, | ||
"license_detections": [], | ||
"license_clues": [], | ||
"percentage_of_license_text": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/MANIFEST.MF", | ||
"type": "file", | ||
"package_data": [ | ||
{ | ||
"type": "jar", | ||
"namespace": null, | ||
"name": "spring-web", | ||
"version": "5.3.20", | ||
"qualifiers": {}, | ||
"subpath": null, | ||
"primary_language": null, | ||
"description": "", | ||
"release_date": null, | ||
"parties": [], | ||
"keywords": [], | ||
"homepage_url": null, | ||
"download_url": null, | ||
"size": null, | ||
"sha1": null, | ||
"md5": null, | ||
"sha256": null, | ||
"sha512": null, | ||
"bug_tracking_url": null, | ||
"code_view_url": null, | ||
"vcs_url": null, | ||
"copyright": null, | ||
"holder": null, | ||
"declared_license_expression": "apache-2.0", | ||
"declared_license_expression_spdx": "Apache-2.0", | ||
"license_detections": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"matches": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"from_file": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt", | ||
"start_line": 4, | ||
"end_line": 6, | ||
"matcher": "2-aho", | ||
"score": 100.0, | ||
"matched_length": 27, | ||
"match_coverage": 100.0, | ||
"rule_relevance": 100, | ||
"rule_identifier": "apache-2.0_701.RULE", | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_701.RULE" | ||
} | ||
], | ||
"detection_log": [], | ||
"identifier": "apache_2_0-dda7c7b6-8825-2c52-d55b-46f66d469baa" | ||
} | ||
], | ||
"other_license_expression": null, | ||
"other_license_expression_spdx": null, | ||
"other_license_detections": [], | ||
"extracted_license_statement": null, | ||
"notice_text": null, | ||
"source_packages": [], | ||
"file_references": [], | ||
"is_private": false, | ||
"is_virtual": false, | ||
"extra_data": {}, | ||
"dependencies": [], | ||
"repository_homepage_url": null, | ||
"repository_download_url": null, | ||
"api_data_url": null, | ||
"datasource_id": "java_jar_manifest", | ||
"purl": "pkg:jar/spring-web@5.3.20" | ||
} | ||
], | ||
"for_packages": [ | ||
"pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758" | ||
], | ||
"detected_license_expression": null, | ||
"detected_license_expression_spdx": null, | ||
"license_detections": [], | ||
"license_clues": [], | ||
"percentage_of_license_text": 0, | ||
"scan_errors": [] | ||
}, | ||
{ | ||
"path": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt", | ||
"type": "file", | ||
"package_data": [], | ||
"for_packages": [ | ||
"pkg:jar/spring-web@5.3.20?uuid=fixed-uid-done-for-testing-5642512d1758" | ||
], | ||
"detected_license_expression": "apache-2.0", | ||
"detected_license_expression_spdx": "Apache-2.0", | ||
"license_detections": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"matches": [ | ||
{ | ||
"license_expression": "apache-2.0", | ||
"license_expression_spdx": "Apache-2.0", | ||
"from_file": "spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt", | ||
"start_line": 4, | ||
"end_line": 6, | ||
"matcher": "2-aho", | ||
"score": 100.0, | ||
"matched_length": 27, | ||
"match_coverage": 100.0, | ||
"rule_relevance": 100, | ||
"rule_identifier": "apache-2.0_701.RULE", | ||
"rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/apache-2.0_701.RULE" | ||
} | ||
], | ||
"detection_log": [], | ||
"identifier": "apache_2_0-dda7c7b6-8825-2c52-d55b-46f66d469baa" | ||
} | ||
], | ||
"license_clues": [], | ||
"percentage_of_license_text": 71.05, | ||
"scan_errors": [] | ||
} | ||
] | ||
} |
Binary file added
BIN
+180 Bytes
tests/packagedcode/data/maven_misc/assemble/spring-web-5.3.20-jar/spring-web-5.3.20.jar
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
...en_misc/assemble/spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/MANIFEST.MF
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Manifest-Version: 1.0 | ||
Implementation-Title: spring-web | ||
Automatic-Module-Name: spring.web | ||
Implementation-Version: 5.3.20 | ||
Created-By: 1.8.0_332 (Oracle Corporation) | ||
|
6 changes: 6 additions & 0 deletions
6
...ven_misc/assemble/spring-web-5.3.20-jar/spring-web-5.3.20.jar-extract/META-INF/notice.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Spring Framework 5.3.20 | ||
Copyright (c) 2002-2022 Pivotal, Inc. | ||
|
||
This product is licensed to you under the Apache License, Version 2.0 | ||
(the "License"). You may not use this product except in compliance with | ||
the License. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may consider using https://github.com/aboutcode-org/commoncode/blob/878be6140deac30e2b95fb0fad9eb8feca015fc8/src/commoncode/resource.py#L1264