diff --git a/docs/built-in-pipelines.rst b/docs/built-in-pipelines.rst index 93d57ff16d..13f8ffda71 100644 --- a/docs/built-in-pipelines.rst +++ b/docs/built-in-pipelines.rst @@ -265,6 +265,14 @@ Scan Single Package :members: :member-order: bysource +.. _pipeline_scan_maven_package: + +Scan Maven Package +------------------- +.. autoclass:: scanpipe.pipelines.scan_maven_package.ScanMavenPackage() + :members: + :member-order: bysource + Fetch Scores (addon) -------------------- .. warning:: diff --git a/pyproject.toml b/pyproject.toml index 89963ce1db..19e3494cf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -165,6 +165,7 @@ publish_to_federatedcode = "scanpipe.pipelines.publish_to_federatedcode:PublishT resolve_dependencies = "scanpipe.pipelines.resolve_dependencies:ResolveDependencies" scan_codebase = "scanpipe.pipelines.scan_codebase:ScanCodebase" scan_for_virus = "scanpipe.pipelines.scan_for_virus:ScanForVirus" +scan_maven_package = "scanpipe.pipelines.scan_maven_package:ScanMavenPackage" scan_single_package = "scanpipe.pipelines.scan_single_package:ScanSinglePackage" [tool.setuptools.packages.find] diff --git a/scanpipe/pipelines/scan_maven_package.py b/scanpipe/pipelines/scan_maven_package.py new file mode 100644 index 0000000000..f69c19ad07 --- /dev/null +++ b/scanpipe/pipelines/scan_maven_package.py @@ -0,0 +1,185 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# http://nexb.com and https://github.com/aboutcode-org/scancode.io +# The ScanCode.io software is licensed under the Apache License version 2.0. +# Data generated with ScanCode.io is provided as-is without warranties. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# Data Generated with ScanCode.io is provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode.io should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# +# ScanCode.io is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/aboutcode-org/scancode.io for support and download. + +from scanpipe.pipelines.deploy_to_develop import DeployToDevelop +from scanpipe.pipelines.scan_single_package import ScanSinglePackage +from scanpipe.pipes import d2d_config +from scanpipe.pipes.maven import check_input_and_return_purl +from scanpipe.pipes.maven import fetch_and_scan_remote_pom +from scanpipe.pipes.maven import fetch_inputs +from scanpipe.pipes.maven import update_package_license_from_resource_if_missing + + +class ScanMavenPackage(ScanSinglePackage, DeployToDevelop): + """ + Scan a single Maven package and perform a deployment to development + relation scan. + + This pipeline takes a Maven PURL as input, fetches the binary and + source archives (if they exist), and then performs scans for package + metadata, declared dependencies, licenses, license clarity scores, and + copyrights. It also performs a deployment to development relation scan + if both the source and binary archives are available. + + The output is a summary of the scan results in JSON format. + """ + + download_inputs = False + + @classmethod + def steps(cls): + return ( + cls.check_input_and_return_purl, + cls.fetch_inputs, + cls.d2d_check, + cls.collect_input_info, + cls.extract_input, + cls.extract_archives, + cls.maven_d2d_steps, + cls.run_scan, + cls.fetch_and_scan_remote_pom, + cls.load_inventory_from_toolkit_scan, + cls.update_package_license_from_resource_if_missing, + cls.make_summary_from_scan_results, + ) + + def check_input_and_return_purl(self): + """Validate the input is a PURL string and return the PURL object.""" + self.purl = check_input_and_return_purl(self.project) + + def fetch_inputs(self): + """Fetch the binary and source of the given PURL.""" + from_file, to_file = fetch_inputs(self.purl) + # The pipeline will call self.extract_inputs_to_codebase_directory() + # from deploy_to_develop.py, which expects both self.from_files and + # self.to_files to be of list type. + self.from_files = [from_file] if from_file else [] + self.to_files = [to_file] if to_file else [] + + def d2d_check(self): + """ + Enable the deployment to development relation scan if both from + and to files are present. + """ + self.d2d_enabled = False + if self.from_files and self.to_files: + self.d2d_enabled = True + + def collect_input_info(self): + """Collect information about the input.""" + if not self.d2d_enabled: + if self.from_files: + self.input_path = self.from_files[0] + else: + self.input_path = self.to_files[0] + self.collect_input_information() + + def extract_input(self): + """Extract the input to the codebase directory.""" + if not self.d2d_enabled: + self.extract_input_to_codebase_directory() + else: + self.extract_inputs_to_codebase_directory() + + def maven_d2d_steps(self): + """Run deployment to development relation scan steps for Maven projects.""" + if self.d2d_enabled: + self.collect_and_create_codebase_resources() + self.fingerprint_codebase_directories() + self.flag_empty_files() + self.flag_whitespace_files() + self.flag_ignored_resources() + self.d2d_ecosystem_config() + self.map_about_files() + self.map_checksum() + self.match_archives_to_purldb() + self.d2d_java() + self.d2d_scala() + self.d2d_kotlin() + self.d2d_javascript() + self.d2d_process() + + def d2d_ecosystem_config(self): + options = ["Java", "Kotlin", "Scala", "JavaScript"] + d2d_config.load_ecosystem_config(pipeline=self, options=options) + + def d2d_java(self): + self.find_java_packages() + self.map_java_to_class() + self.map_jar_to_java_source() + + def d2d_scala(self): + self.find_scala_packages() + self.map_scala_to_class() + self.map_jar_to_scala_source() + + def d2d_kotlin(self): + self.find_kotlin_packages() + self.map_kotlin_to_class() + self.map_jar_to_kotlin_source() + + def d2d_javascript(self): + self.map_javascript() + self.map_javascript_symbols() + self.map_javascript_strings() + + def d2d_process(self): + self.get_symbols_from_binaries() + self.map_elf() + self.match_directories_to_purldb() + self.match_resources_to_purldb() + self.map_javascript_post_purldb_match() + self.map_javascript_path() + self.map_javascript_colocation() + self.map_path() + self.flag_mapped_resources_archives_and_ignored_directories() + self.perform_house_keeping_tasks() + self.match_purldb_resources_post_process() + self.remove_packages_without_resources() + self.scan_ignored_to_files() + self.scan_unmapped_to_files() + self.scan_mapped_from_for_files() + self.collect_and_create_license_detections() + self.flag_deployed_from_resources_with_missing_license() + self.create_local_files_packages() + + def fetch_and_scan_remote_pom(self): + """Fetch and scan remote POM files.""" + scanning_errors = fetch_and_scan_remote_pom( + self.purl, self.scan_output_location + ) + for scanning_error in scanning_errors: + for resource_reference, errors in scanning_error.items(): + self.project.add_error( + description="\n".join(errors), + model=self.pipeline_name, + details={ + "resource_path": resource_reference.removeprefix("codebase/") + }, + ) + + def update_package_license_from_resource_if_missing(self): + """ + Fill in missing package licenses using licenses detected in + their resources. + """ + update_package_license_from_resource_if_missing(self.project) diff --git a/scanpipe/pipes/d2d.py b/scanpipe/pipes/d2d.py index f38fe859f3..2e7b2d18dd 100644 --- a/scanpipe/pipes/d2d.py +++ b/scanpipe/pipes/d2d.py @@ -353,7 +353,7 @@ def map_jar_to_jvm_source(project, jvm_lang: jvm.JvmLanguage, logger=None): """Map .jar files to their related source directory.""" project_files = project.codebaseresources.files() # Include the directories to map on the common source - from_resources = project.codebaseresources.from_codebase() + from_resources = project.codebaseresources.from_codebase().has_no_relation() to_resources = project_files.to_codebase() to_jars = to_resources.filter(extension=".jar") diff --git a/scanpipe/pipes/maven.py b/scanpipe/pipes/maven.py new file mode 100644 index 0000000000..0c783f0da7 --- /dev/null +++ b/scanpipe/pipes/maven.py @@ -0,0 +1,208 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# http://nexb.com and https://github.com/aboutcode-org/scancode.io +# The ScanCode.io software is licensed under the Apache License version 2.0. +# Data generated with ScanCode.io is provided as-is without warranties. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# Data Generated with ScanCode.io is provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode.io should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# +# ScanCode.io is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/aboutcode-org/scancode.io for support and download. + +import json +import logging +from pathlib import PurePosixPath +from urllib.parse import urlparse + +import requests +from license_expression import Licensing +from packageurl import PackageURL +from packageurl.contrib import purl2url + +from scanpipe.pipes import fetch +from scanpipe.pipes import scancode + +logger = logging.getLogger(__name__) + + +def check_input_and_return_purl(project): + """Validate the input and return a maven PURL.""" + input_sources = project.inputsources.all() + if len(input_sources) != 1: + error_msg = "Only 1 maven purl is accepted." + raise ValueError(error_msg) + # Strip the qualifiers as this is not needed. + project_input = str(input_sources[0]).split("?")[0] + input_purl = PackageURL.from_string(project_input) + + if input_purl.type != "maven": + error_msg = "Only maven purl is supported." + raise ValueError(error_msg) + if not input_purl.version: + error_msg = "Version is required." + raise ValueError(error_msg) + + return input_purl + + +def fetch_inputs(purl): + """Fetch the binary and source for the given input purl""" + purl_str = PackageURL.to_string(purl) + + purl_bin_path = fetch_path(purl_str, "binary") + purl_src_path = fetch_path(f"{purl_str}?classifier=sources", "source") + + if not purl_bin_path and not purl_src_path: + err_msg = f"No source or binary could be resolved for {purl}." + raise ValueError(err_msg) + + return purl_src_path, purl_bin_path + + +def fetch_path(purl, package_type): + """Fetch the purl and return the location of the fetched tarball""" + try: + return fetch.fetch_url(url=purl).path + except (ValueError, requests.RequestException) as e: + logger.warning("Failed to fetch %s package: %s", package_type, e) + return None + + +def fetch_and_scan_remote_pom(input_purl, scan_output_location): + """Fetch the .pom file from from maven.org if not present in codebase.""" + with open(scan_output_location) as file: + data = json.load(file) + # Skip fetching the remote POM if a pom.xml is already present in the codebase. + for file_entry in data["files"]: + if PurePosixPath(file_entry["path"]).name == "pom.xml": + return [] + + pom_url = get_pom_url(input_purl) + if not pom_url: + return [{str(input_purl): ["Failed to resolve POM URL."]}] + pom_file = download_pom_file(pom_url) + if not pom_file: + return [{pom_url: ["Failed to download the POM file."]}] + scanning_errors = scan_pom_file(pom_file) + + scanned_pom_packages, scanned_dependencies = update_datafile_paths(pom_file) + updated_data = update_scan_data(data, scanned_pom_packages, scanned_dependencies) + + with open(scan_output_location, "w") as file: + json.dump(updated_data, file, indent=2) + if not scanning_errors: + return [] + return [scanning_errors] if isinstance(scanning_errors, dict) else scanning_errors + + +def update_scan_data(data, scanned_packages, scanned_dependencies): + """Update packages and dependencies data""" + data["packages"] = data.get("packages", []) + scanned_packages + data["dependencies"] = data.get("dependencies", []) + scanned_dependencies + return data + + +def get_pom_url(input_purl): + """Construct a Maven POM URL from the input purl.""" + purl_str = PackageURL.to_string(input_purl) + input_source_url = purl2url.get_download_url(purl_str) + if not input_source_url: + return "" + + parsed_url = urlparse(input_source_url) + maven_hosts = { + "repo1.maven.org", + "repo.maven.apache.org", + "maven.google.com", + } + pom_url = "" + if parsed_url.netloc in maven_hosts: + base_url = input_source_url.rsplit("/", 1)[0] + pom_url = f"{base_url}/{input_purl.name}-{input_purl.version}.pom" + return pom_url + + +def download_pom_file(pom_url): + """Fetch the pom file from the input pom_url""" + try: + downloaded_pom = fetch.fetch_http(pom_url) + except requests.RequestException: + return {} + path = str(downloaded_pom.path) + return { + "pom_file_path": path, + "output_path": f"{path}-output.json", + "pom_url": pom_url, + } + + +def scan_pom_file(pom_file_dict): + """Fetch and scan the pom file from the input pom_urls""" + pom_file_path = pom_file_dict.get("pom_file_path", "") + scanned_pom_output_path = pom_file_dict.get("output_path", "") + + # Run a package scan on the fetched pom.xml + # Return scanning errors, if present + return scancode.run_scan( + location=pom_file_path, + output_file=scanned_pom_output_path, + run_scan_args={ + "package": True, + }, + ) + + +def update_datafile_paths(pom_file_dict): + """Update datafile_paths in scanned packages and dependencies.""" + scanned_pom_packages = [] + scanned_pom_deps = [] + + scanned_pom_output_path = pom_file_dict.get("output_path", "") + pom_url = pom_file_dict.get("pom_url", "") + + with open(scanned_pom_output_path) as scanned_pom_file: + scanned_pom_data = json.load(scanned_pom_file) + + scanned_packages = scanned_pom_data.get("packages", []) + scanned_dependencies = scanned_pom_data.get("dependencies", []) + + for scanned_package in scanned_packages: + scanned_package["datafile_paths"] = [pom_url] + scanned_pom_packages.append(scanned_package) + for scanned_dep in scanned_dependencies: + # See https://github.com/aboutcode-org/scancode.io/issues/1763#issuecomment-3525165830 + scanned_dep["datafile_path"] = "" + scanned_pom_deps.append(scanned_dep) + return scanned_pom_packages, scanned_pom_deps + + +def update_package_license_from_resource_if_missing(project): + """Populate missing licenses to packages based on resource data.""" + for package in project.discoveredpackages.all(): + if not package.get_declared_license_expression(): + matching_resources = ( + project.codebaseresources.has_license_expression().filter( + discovered_packages=package + ) + ) + detected_licenses = list( + matching_resources.values_list( + "detected_license_expression", flat=True + ).distinct() + ) + if detected_licenses: + license_expression = " AND ".join(detected_licenses) + declared_license_expression = str(Licensing().dedup(license_expression)) + package.declared_license_expression = declared_license_expression + package.save() diff --git a/scanpipe/templates/scanpipe/includes/vulnerability_id.html b/scanpipe/templates/scanpipe/includes/vulnerability_id.html index ea7f6922bd..b25b6cf712 100644 --- a/scanpipe/templates/scanpipe/includes/vulnerability_id.html +++ b/scanpipe/templates/scanpipe/includes/vulnerability_id.html @@ -27,4 +27,4 @@ {% endfor %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/scanpipe/templates/scanpipe/tabset/tab_vulnerabilities.html b/scanpipe/templates/scanpipe/tabset/tab_vulnerabilities.html index 9fc65d62b5..37eaf0bdcc 100644 --- a/scanpipe/templates/scanpipe/tabset/tab_vulnerabilities.html +++ b/scanpipe/templates/scanpipe/tabset/tab_vulnerabilities.html @@ -35,4 +35,4 @@ {% endfor %} - \ No newline at end of file + diff --git a/scanpipe/tests/data/jvm/args4j-tools-2.0.16-sctk.json b/scanpipe/tests/data/jvm/args4j-tools-2.0.16-sctk.json new file mode 100644 index 0000000000..7bbe7e11f0 --- /dev/null +++ b/scanpipe/tests/data/jvm/args4j-tools-2.0.16-sctk.json @@ -0,0 +1,2424 @@ +{ + "headers": [ + { + "tool_name": "scancode-toolkit", + "tool_version": "32.5.0", + "options": { + "--copyright": true, + "--email": true, + "--info": true, + "--license": true, + "--license-text": true, + "--license-diagnostics": true, + "--license-text-diagnostics": true, + "--license-references": true, + "--package": true, + "--url": true, + "--classify": true, + "--summary": true, + "--todo": true + }, + "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", + "start_timestamp": "2026-07-14T084213.461650", + "end_timestamp": "2026-07-14T084222.711597", + "output_format_version": "4.1.0", + "duration": 9.24999213218689, + "message": null, + "errors": [], + "warnings": [], + "extra_data": { + "system_environment": { + "operating_system": "linux", + "cpu_architecture": "64", + "platform": "Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39", + "platform_version": "#1 SMP PREEMPT_DYNAMIC Thu Jun 18 21:54:43 UTC 2026", + "python_version": "3.13.0 (main, Nov 11 2025, 11:11:38) [GCC 13.3.0]" + }, + "spdx_license_list_version": "3.27", + "files_count": 24 + } + } + ], + "summary": { + "declared_license_expression": null, + "license_clarity_score": { + "score": 0, + "declared_license": false, + "identification_precision": false, + "has_license_text": false, + "declared_copyrights": false, + "conflicting_license_categories": false, + "ambiguous_compound_licensing": true + }, + "declared_holder": "", + "primary_language": "Java", + "other_license_expressions": [], + "other_holders": [ + { + "value": null, + "count": 24 + } + ], + "other_languages": [] + }, + "todo": [ + { + "detection_id": "pkg:jar/unknown-af7c47b2-089b-fb22-5da5-4c612b327e1b", + "review_comments": { + "cannot-create-purl": "The package data detected doesn't have enough fields to create a packageURL (required fields are type, name and version), and it is also not a lockfile or similar which has dependencies. This is likely due to a package manifest with insufficient data, but a package manifest which has to be reviewed anyway." + }, + "detection": { + "type": "jar", + "namespace": null, + "name": null, + "version": null, + "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": 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_manifest", + "purl": null + } + } + ], + "packages": [ + { + "type": "maven", + "namespace": "args4j", + "name": "args4j-tools", + "version": "2.0.16", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "args4j-tools\ndevelopment-time tool for generating additional artifacits", + "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": [ + "pkg:maven/args4j/args4j-tools@2.0.16?classifier=sources" + ], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/", + "repository_download_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/args4j-tools-2.0.16.jar", + "api_data_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/args4j-tools-2.0.16.pom", + "package_uid": "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893", + "datafile_paths": [ + "codebase/to/META-INF/maven/args4j/args4j-tools/pom.xml" + ], + "datasource_ids": [ + "maven_pom" + ], + "purl": "pkg:maven/args4j/args4j-tools@2.0.16" + } + ], + "dependencies": [ + { + "purl": "pkg:maven/ant/ant@1.5", + "extracted_requirement": "1.5", + "scope": "compile", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:maven/ant/ant@1.5?uuid=0d1f7d9d-640d-44e2-a83d-0bbc9363d2b6", + "for_package_uid": "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893", + "datafile_path": "codebase/to/META-INF/maven/args4j/args4j-tools/pom.xml", + "datasource_id": "maven_pom" + }, + { + "purl": "pkg:maven/args4j/args4j@2.0.16", + "extracted_requirement": "2.0.16", + "scope": "compile", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:maven/args4j/args4j@2.0.16?uuid=3378adcb-3960-45de-9412-ab0770bbd514", + "for_package_uid": "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893", + "datafile_path": "codebase/to/META-INF/maven/args4j/args4j-tools/pom.xml", + "datasource_id": "maven_pom" + }, + { + "purl": "pkg:maven/junit/junit@3.8.2", + "extracted_requirement": "3.8.2", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:maven/junit/junit@3.8.2?uuid=f65858bc-6cb5-4884-bad8-3886ebbfb696", + "for_package_uid": "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893", + "datafile_path": "codebase/to/META-INF/maven/args4j/args4j-tools/pom.xml", + "datasource_id": "maven_pom" + } + ], + "license_detections": [], + "license_references": [], + "license_rule_references": [], + "files": [ + { + "path": "codebase", + "type": "directory", + "name": "codebase", + "base_name": "codebase", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 24, + "dirs_count": 17, + "size_count": 39020, + "scan_errors": [] + }, + { + "path": "codebase/from", + "type": "directory", + "name": "from", + "base_name": "from", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 10, + "dirs_count": 6, + "size_count": 12961, + "scan_errors": [] + }, + { + "path": "codebase/from/META-INF", + "type": "directory", + "name": "META-INF", + "base_name": "META-INF", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 159, + "scan_errors": [] + }, + { + "path": "codebase/from/META-INF/MANIFEST.MF", + "type": "file", + "name": "MANIFEST.MF", + "base_name": "MANIFEST", + "extension": ".MF", + "size": 106, + "date": "2009-09-03", + "sha1": "75e4b88be7bcf8ef406837764b3655b569732ce8", + "md5": "3e99edf8abae4a68cb9048ba19b9f952", + "sha256": "7b731d3fbecc60e3c39250bb86e5f5016e6c170b7899c0aa1d89a8faa3d57ea7", + "sha1_git": "2cdcf53143a2fc8a9e1f210ab97b3849ed3411a1", + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [ + "pkg:jar/unknown-af7c47b2-089b-fb22-5da5-4c612b327e1b" + ], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [ + { + "type": "jar", + "namespace": null, + "name": null, + "version": null, + "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": 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_manifest", + "purl": null + } + ], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/META-INF/services", + "type": "directory", + "name": "services", + "base_name": "services", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 53, + "scan_errors": [] + }, + { + "path": "codebase/from/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory", + "type": "file", + "name": "com.sun.mirror.apt.AnnotationProcessorFactory", + "base_name": "com.sun.mirror.apt", + "extension": ".AnnotationProcessorFactory", + "size": 53, + "date": "2005-05-10", + "sha1": "e9f248c67f084a97d940a8541836bb4be2c4f8b8", + "md5": "53170aa3631a841710aeef29c285f50c", + "sha256": "19448ec44cbe4bf33169d4531b9030eced255a5d4061d4843fa59337bdf2be6c", + "sha1_git": "69cf068791fe4848f9f575a623b1f76beeb1a67f", + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org", + "type": "directory", + "name": "org", + "base_name": "org", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 8, + "dirs_count": 3, + "size_count": 12802, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke", + "type": "directory", + "name": "kohsuke", + "base_name": "kohsuke", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 8, + "dirs_count": 2, + "size_count": 12802, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j", + "type": "directory", + "name": "args4j", + "base_name": "args4j", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 8, + "dirs_count": 1, + "size_count": 12802, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt", + "type": "directory", + "name": "apt", + "base_name": "apt", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 8, + "dirs_count": 0, + "size_count": 12802, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/AnnotationProcessorFactoryImpl.java", + "type": "file", + "name": "AnnotationProcessorFactoryImpl.java", + "base_name": "AnnotationProcessorFactoryImpl", + "extension": ".java", + "size": 5260, + "date": "2005-05-29", + "sha1": "5511bfb656ad8d98c24c7e0e72c82b789d2583a3", + "md5": "04c7b673940f4d1cb37897250e891171", + "sha256": "54aa9afe17b580c330b891fa03d03036e1bda45740326f054591fcb2cae1efa3", + "sha1_git": "62c4597d8bab244cd77745d4c765de856b6fea8e", + "mime_type": "text/x-java", + "file_type": "Java source, ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 34, + "end_line": 34 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/AnnotationVisitor.java", + "type": "file", + "name": "AnnotationVisitor.java", + "base_name": "AnnotationVisitor", + "extension": ".java", + "size": 169, + "date": "2005-05-10", + "sha1": "703a208ca5544fb062c530ceb7f9a8e3b6adf7e5", + "md5": "e8a8986aa1125ed3413b26ecdcd662f2", + "sha256": "7b578e0f63a71c7c2a8b0656e0a59f80e30a7fada0c7941ccc87f643ece1b693", + "sha1_git": "c07b133fa7efc3f5b591b09eb2e14fa5fb53c98f", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 6, + "end_line": 6 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/HtmlWriter.java", + "type": "file", + "name": "HtmlWriter.java", + "base_name": "HtmlWriter", + "extension": ".java", + "size": 877, + "date": "2005-05-10", + "sha1": "6e885b34bab1109eda4bcc49b26edc9623a929cf", + "md5": "26106e1bf23422710f3985ec727b7eb6", + "sha256": "2acdec7df802e8d351d7daab8af8006bf35e6e9c866e1269087846be7a7eea92", + "sha1_git": "f540eba17acee8401bf0548f3b79b3307814fb39", + "mime_type": "text/html", + "file_type": "HTML document, ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 9, + "end_line": 9 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/IsolatingClassLoader.java", + "type": "file", + "name": "IsolatingClassLoader.java", + "base_name": "IsolatingClassLoader", + "extension": ".java", + "size": 731, + "date": "2005-05-10", + "sha1": "3ff3362d44a7182f05b57d28206ae32c7a5db44f", + "md5": "a2d61d736c7e93bdab99f4c4f0cd901d", + "sha256": "eb2bb43893571c63ba7c68c09a19d1f46561ae0c4bde39f3535c67e61af135f5", + "sha1_git": "baff8fedbd05ad93694ccc362b6a2f97146345af", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 4, + "end_line": 4 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/Main.java", + "type": "file", + "name": "Main.java", + "base_name": "Main", + "extension": ".java", + "size": 3669, + "date": "2005-05-29", + "sha1": "5bdc1f60de66f823ccfe08fe411c2ca5d26570a4", + "md5": "bee748f1990886a5132a4803fbb2eadc", + "sha256": "86345c08973f9ef356135c9d1ae01f645e395a5cbb12494467cedd367b38917d", + "sha1_git": "dd354d776e064949abbb3860b0fcb97c29631495", + "mime_type": "text/x-c", + "file_type": "C source, ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 18, + "end_line": 18 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/Mode.java", + "type": "file", + "name": "Mode.java", + "base_name": "Mode", + "extension": ".java", + "size": 105, + "date": "2005-05-10", + "sha1": "39a42f494fe141a376a2f9cf7c182423dca29c89", + "md5": "1922961d6cb77710737a2a698258520a", + "sha256": "ca029cf01b39ceb7762b131785b7a019f76e785d2ae44c12d3400676c3b598e7", + "sha1_git": "561f4070b5466114840bec99219ce6f4e2d376c8", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 4, + "end_line": 4 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/ReloadingClassLoader.java", + "type": "file", + "name": "ReloadingClassLoader.java", + "base_name": "ReloadingClassLoader", + "extension": ".java", + "size": 1086, + "date": "2005-05-10", + "sha1": "605846742ae299aea7a2c36f5c09e18da8dbac44", + "md5": "140d1eb405e734ccc9ccae0ade607618", + "sha256": "33b84b72ff6f848327b66bf848969d51d86e069de8e8a53c81be3edc63afb21a", + "sha1_git": "5bb7386b6a028aff5a77437491355e1be7530cdc", + "mime_type": "text/x-java", + "file_type": "Java source, ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 10, + "end_line": 10 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/from/org/kohsuke/args4j/apt/XmlWriter.java", + "type": "file", + "name": "XmlWriter.java", + "base_name": "XmlWriter", + "extension": ".java", + "size": 905, + "date": "2005-05-10", + "sha1": "e50a84a0a6d7494e21e27c92e6293d795c53f647", + "md5": "3cf712768715370819048d17828062c8", + "sha256": "2dbed05d868e4052b9afb01da9b29c58d5a76ed7028563ac2ea6f6146bc8074b", + "sha1_git": "10548838d44218d17c12ae8fe3c4c975d3e482b1", + "mime_type": "text/x-java", + "file_type": "Java source, ASCII text", + "programming_language": "Java", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [ + { + "author": "Kohsuke Kawaguchi", + "start_line": 11, + "end_line": 11 + } + ], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to", + "type": "directory", + "name": "to", + "base_name": "to", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 14, + "dirs_count": 9, + "size_count": 26059, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF", + "type": "directory", + "name": "META-INF", + "base_name": "META-INF", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 4, + "dirs_count": 4, + "size_count": 2628, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/MANIFEST.MF", + "type": "file", + "name": "MANIFEST.MF", + "base_name": "MANIFEST", + "extension": ".MF", + "size": 220, + "date": "2009-09-03", + "sha1": "559e354ae61d62fc58d522716008369e2b388d44", + "md5": "d2de433b55bd37f2bbade7047fa08dca", + "sha256": "efc7e442678a404ac146b37a2c0af63f45ccab24a0e359246ccb239697497b4b", + "sha1_git": "31fe5b9e6fdcd4c371ca86bd7c9b8165e49e2583", + "mime_type": "text/plain", + "file_type": "ASCII text, with CRLF line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": true, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [ + { + "type": "jar", + "namespace": null, + "name": null, + "version": null, + "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": 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_manifest", + "purl": null + } + ], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/maven", + "type": "directory", + "name": "maven", + "base_name": "maven", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 2, + "dirs_count": 2, + "size_count": 2355, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/maven/args4j", + "type": "directory", + "name": "args4j", + "base_name": "args4j", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 2355, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/maven/args4j/args4j-tools", + "type": "directory", + "name": "args4j-tools", + "base_name": "args4j-tools", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 2, + "dirs_count": 0, + "size_count": 2355, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/maven/args4j/args4j-tools/pom.properties", + "type": "file", + "name": "pom.properties", + "base_name": "pom", + "extension": ".properties", + "size": 104, + "date": "2009-09-03", + "sha1": "1a62d829bca2b81bce1038749ff21c52f658b4ff", + "md5": "f5670810cb0b34627734d91a9db12fff", + "sha256": "613d58916a2143358652d003ef28a1d090e92cf21ce2f8fd7f0e022d3e7b216f", + "sha1_git": "8b55f6fd48a9ca968e6f173440ab4172908346dc", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": true, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [ + { + "type": "maven", + "namespace": "args4j", + "name": "args4j-tools", + "version": "2.0.16", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "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": "maven_pom_properties", + "purl": "pkg:maven/args4j/args4j-tools@2.0.16" + } + ], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/maven/args4j/args4j-tools/pom.xml", + "type": "file", + "name": "pom.xml", + "base_name": "pom", + "extension": ".xml", + "size": 2251, + "date": "2009-09-03", + "sha1": "b0c21567d460d7ec7b621ec21e1c76e7fced709b", + "md5": "6c02d58f9c3b2561601a18ef307a7773", + "sha256": "1b9f8aa7089930c6765ae0355bdc4059f30d4e60e24a378986ce51b6d4f9647a", + "sha1_git": "b2b869a3abdc8721f74274fcad38ca967e651597", + "mime_type": "text/xml", + "file_type": "XML 1.0 document, ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": true, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [ + { + "type": "maven", + "namespace": "args4j", + "name": "args4j-tools", + "version": "2.0.16", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "args4j-tools\ndevelopment-time tool for generating additional artifacits", + "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": [ + "pkg:maven/args4j/args4j-tools@2.0.16?classifier=sources" + ], + "file_references": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:maven/ant/ant@1.5", + "extracted_requirement": "1.5", + "scope": "compile", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/args4j/args4j@2.0.16", + "extracted_requirement": "2.0.16", + "scope": "compile", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/junit/junit@3.8.2", + "extracted_requirement": "3.8.2", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_pinned": true, + "is_direct": true, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/", + "repository_download_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/args4j-tools-2.0.16.jar", + "api_data_url": "https://repo1.maven.org/maven2/args4j/args4j-tools/2.0.16/args4j-tools-2.0.16.pom", + "datasource_id": "maven_pom", + "purl": "pkg:maven/args4j/args4j-tools@2.0.16" + } + ], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/services", + "type": "directory", + "name": "services", + "base_name": "services", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 1, + "dirs_count": 0, + "size_count": 53, + "scan_errors": [] + }, + { + "path": "codebase/to/META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory", + "type": "file", + "name": "com.sun.mirror.apt.AnnotationProcessorFactory", + "base_name": "com.sun.mirror.apt", + "extension": ".AnnotationProcessorFactory", + "size": 53, + "date": "2009-09-03", + "sha1": "e9f248c67f084a97d940a8541836bb4be2c4f8b8", + "md5": "53170aa3631a841710aeef29c285f50c", + "sha256": "19448ec44cbe4bf33169d4531b9030eced255a5d4061d4843fa59337bdf2be6c", + "sha1_git": "69cf068791fe4848f9f575a623b1f76beeb1a67f", + "mime_type": "text/plain", + "file_type": "ASCII text, with no line terminators", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org", + "type": "directory", + "name": "org", + "base_name": "org", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 10, + "dirs_count": 3, + "size_count": 23431, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke", + "type": "directory", + "name": "kohsuke", + "base_name": "kohsuke", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 10, + "dirs_count": 2, + "size_count": 23431, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j", + "type": "directory", + "name": "args4j", + "base_name": "args4j", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 10, + "dirs_count": 1, + "size_count": 23431, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt", + "type": "directory", + "name": "apt", + "base_name": "apt", + "extension": "", + "size": 0, + "date": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha1_git": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 10, + "dirs_count": 0, + "size_count": 23431, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/AnnotationProcessorFactoryImpl$1$1.class", + "type": "file", + "name": "AnnotationProcessorFactoryImpl$1$1.class", + "base_name": "AnnotationProcessorFactoryImpl$1$1", + "extension": ".class", + "size": 1512, + "date": "2009-09-03", + "sha1": "04e576daa40434ede9086ee0da2228ff1ed640db", + "md5": "0a324d0744403dcc1645f38982ea8665", + "sha256": "f9a47946528e854d4183034ccb12c2c45a88feb08f290978183bba92a9bf0e74", + "sha1_git": "672c72cec905fe13794a02c5affec8dff8d4e75d", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/AnnotationProcessorFactoryImpl$1.class", + "type": "file", + "name": "AnnotationProcessorFactoryImpl$1.class", + "base_name": "AnnotationProcessorFactoryImpl$1", + "extension": ".class", + "size": 4435, + "date": "2009-09-03", + "sha1": "ced8448a56e4e4faa4b601bb1a51c6b4893d8e95", + "md5": "ac4892f5c09686021e5591e0eb6152ee", + "sha256": "8cd7396652df0559b794f0e2376c6c1f8a7f1aa8e8a474666333394fe6fd694e", + "sha1_git": "dfd56deff3f24885dd137bd18a38fce79d5e1534", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/AnnotationProcessorFactoryImpl.class", + "type": "file", + "name": "AnnotationProcessorFactoryImpl.class", + "base_name": "AnnotationProcessorFactoryImpl", + "extension": ".class", + "size": 5181, + "date": "2009-09-03", + "sha1": "dfd56e24abfe722b7eef52211d6ff0085f009ae9", + "md5": "5e70c465115c102feba67be7fe4246ab", + "sha256": "bff2f08747d753e478fdd127421cf2b348c8dba1529943f8ba550aa927e2eec1", + "sha1_git": "8003b5ee43cc0c4080a3850b1c959c0ff2d5aab1", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/AnnotationVisitor.class", + "type": "file", + "name": "AnnotationVisitor.class", + "base_name": "AnnotationVisitor", + "extension": ".class", + "size": 220, + "date": "2009-09-03", + "sha1": "4100071d549b479d91c0a6dd1ef255333b9257e7", + "md5": "dfe813a68157610022aceb46ba355791", + "sha256": "b1d8314f9a194b9e938e091d3b2cde06b94875ec3ea83a304c27ebc374bd7227", + "sha1_git": "dd205e6135c01e8186ea81ee69c08fdcc21cf7d7", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/HtmlWriter.class", + "type": "file", + "name": "HtmlWriter.class", + "base_name": "HtmlWriter", + "extension": ".class", + "size": 1462, + "date": "2009-09-03", + "sha1": "f5d57dbe4059f75c2fb81c6d67d7d6529e3c7faa", + "md5": "9abf86917f8f4485f6088e2cceb649ac", + "sha256": "eafd5df60809e9595bd3161c9f62433f02409fee7c3d4e841f70a02094e055fd", + "sha1_git": "11ad93977d7a3d28a4212ddb03cd6f928da8d435", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/IsolatingClassLoader.class", + "type": "file", + "name": "IsolatingClassLoader.class", + "base_name": "IsolatingClassLoader", + "extension": ".class", + "size": 1149, + "date": "2009-09-03", + "sha1": "9a709eabb210b70b8ac430e324f8ee12dc0a9e54", + "md5": "792daab2294957c3eab1522b67dc9105", + "sha256": "61103984625c78968511aadad2db51163c07c3b90919b0b8172c6733c20b6fc9", + "sha1_git": "3f430508deef5e006cb1d74b089857134824a883", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/Main.class", + "type": "file", + "name": "Main.class", + "base_name": "Main", + "extension": ".class", + "size": 5217, + "date": "2009-09-03", + "sha1": "5b3c4a9e01052de026636340730d7b73de175ff4", + "md5": "b5897105db0795e933f9ef940a9f66c4", + "sha256": "45475d1a53795f33ed1c5bc6a5b73b5099638f9694ba816698d163737182c3f3", + "sha1_git": "5d0c397048e35d6a7c7f8aba1ee9fb264124c2b4", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/Mode.class", + "type": "file", + "name": "Mode.class", + "base_name": "Mode", + "extension": ".class", + "size": 973, + "date": "2009-09-03", + "sha1": "accbf94251068bd1f260ccd20ad52448662b422a", + "md5": "6a26966e5fec0deaaa193e1cd5307271", + "sha256": "c78d206912217b722a46805571bc42868e9e45355600551daefb60715b849d75", + "sha1_git": "03fdc83037a04e71470b5bae79d7cd8f8176bdd9", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/ReloadingClassLoader.class", + "type": "file", + "name": "ReloadingClassLoader.class", + "base_name": "ReloadingClassLoader", + "extension": ".class", + "size": 1735, + "date": "2009-09-03", + "sha1": "ec521f6da526eefe857c0c973549ed45f726fce4", + "md5": "58a24e753e34aeb421f4ae6c6bb81c40", + "sha256": "9b6e87dcb3081abb340b412a5d24f4579f02f83c52daff225022d80f974dd7b2", + "sha1_git": "b40f032c313edc1d17e25b9ac5ce3a2a96c7b8bd", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "codebase/to/org/kohsuke/args4j/apt/XmlWriter.class", + "type": "file", + "name": "XmlWriter.class", + "base_name": "XmlWriter", + "extension": ".class", + "size": 1547, + "date": "2009-09-03", + "sha1": "754ab7809c036c2f1cd9f79d4c41afed7924c787", + "md5": "4100ba9f1429e6140a70751bf5975a36", + "sha256": "4a350c940cc28b74f47eff04d36bd1ca001caae9b4df6e060cc4acfb32e25ced", + "sha1_git": "de317a58d45f952769c7bc97c790c7d97f60ef64", + "mime_type": "application/x-java-applet", + "file_type": "compiled Java class data, version 49.0 (Java 1.5)", + "programming_language": null, + "is_binary": true, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/args4j/args4j-tools@2.0.16?uuid=362e3203-4902-4f8b-b655-38f1ea0e8893" + ], + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/scanpipe/tests/data/jvm/args4j-tools-2.0.16.jar b/scanpipe/tests/data/jvm/args4j-tools-2.0.16.jar new file mode 100644 index 0000000000..dce740c9bc Binary files /dev/null and b/scanpipe/tests/data/jvm/args4j-tools-2.0.16.jar differ diff --git a/scanpipe/tests/data/maven/lic_in_package.json b/scanpipe/tests/data/maven/lic_in_package.json new file mode 100644 index 0000000000..ba0c29eb66 --- /dev/null +++ b/scanpipe/tests/data/maven/lic_in_package.json @@ -0,0 +1,153 @@ +{ + "headers": [ + ], + "summary": { + }, + "todo": [ + ], + "packages": [ + { + "type": "maven", + "namespace": "com.google.guava", + "name": "guava", + "version": "33.5.0-jre", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "Guava: Google Core Libraries for Java\nGuava is a suite of core and expanded libraries that include\n utility classes, Google's collections, I/O classes, and\n much more.", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": "https://github.com/google/guava", + "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": "custom", + "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": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?classifier=sources" + ], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/", + "repository_download_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.jar", + "api_data_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.pom", + "package_uid": "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=351d0e6b-7ee0-4f4a-8450-649bf298d00f", + "datafile_paths": [ + "codebase/META-INF/maven/com.google.guava/guava/pom.xml" + ], + "datasource_ids": [ + "maven_pom" + ], + "purl": "pkg:maven/com.google.guava/guava@33.5.0-jre" + } + ], + "dependencies": [ + ], + "license_detections": [ + ], + "license_references": [ + ], + "license_rule_references": [ + ], + "files": [ + { + "path": "codebase/META-INF/LICENSE", + "type": "file", + "name": "LICENSE", + "base_name": "LICENSE", + "extension": "", + "size": 11358, + "date": "1980-02-01", + "sha1": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "md5": "3b83ef96387f14655fc854ddc3c6bd57", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "sha1_git": "d645695673349e3947e8e5ae42332d0ac3164cd7", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": true, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=351d0e6b-7ee0-4f4a-8450-649bf298d00f" + ], + "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": "codebase/META-INF/LICENSE", + "start_line": 2, + "end_line": 202, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 1584, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/apache-2.0.LICENSE", + "matched_text": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.", + "matched_text_diagnostics": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License." + } + ], + "detection_log": [], + "identifier": "apache_2_0-ab23f79b-ec38-9a8a-9b23-85059407f34d" + } + ], + "license_clues": [], + "percentage_of_license_text": 100.0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [ + { + "url": "http://www.apache.org/licenses/", + "start_line": 4, + "end_line": 4 + }, + { + "url": "http://www.apache.org/licenses/LICENSE-2.0", + "start_line": 196, + "end_line": 196 + } + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} diff --git a/scanpipe/tests/data/maven/missing_lic_in_package.json b/scanpipe/tests/data/maven/missing_lic_in_package.json new file mode 100644 index 0000000000..4af0b4e1fa --- /dev/null +++ b/scanpipe/tests/data/maven/missing_lic_in_package.json @@ -0,0 +1,153 @@ +{ + "headers": [ + ], + "summary": { + }, + "todo": [ + ], + "packages": [ + { + "type": "maven", + "namespace": "com.google.guava", + "name": "guava", + "version": "33.5.0-jre", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "Guava: Google Core Libraries for Java\nGuava is a suite of core and expanded libraries that include\n utility classes, Google's collections, I/O classes, and\n much more.", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": "https://github.com/google/guava", + "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": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?classifier=sources" + ], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/", + "repository_download_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.jar", + "api_data_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.pom", + "package_uid": "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=351d0e6b-7ee0-4f4a-8450-649bf298d00f", + "datafile_paths": [ + "codebase/META-INF/maven/com.google.guava/guava/pom.xml" + ], + "datasource_ids": [ + "maven_pom" + ], + "purl": "pkg:maven/com.google.guava/guava@33.5.0-jre" + } + ], + "dependencies": [ + ], + "license_detections": [ + ], + "license_references": [ + ], + "license_rule_references": [ + ], + "files": [ + { + "path": "codebase/META-INF/LICENSE", + "type": "file", + "name": "LICENSE", + "base_name": "LICENSE", + "extension": "", + "size": 11358, + "date": "1980-02-01", + "sha1": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "md5": "3b83ef96387f14655fc854ddc3c6bd57", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "sha1_git": "d645695673349e3947e8e5ae42332d0ac3164cd7", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": true, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=351d0e6b-7ee0-4f4a-8450-649bf298d00f" + ], + "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": "codebase/META-INF/LICENSE", + "start_line": 2, + "end_line": 202, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 1584, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/apache-2.0.LICENSE", + "matched_text": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.", + "matched_text_diagnostics": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License." + } + ], + "detection_log": [], + "identifier": "apache_2_0-ab23f79b-ec38-9a8a-9b23-85059407f34d" + } + ], + "license_clues": [], + "percentage_of_license_text": 100.0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [ + { + "url": "http://www.apache.org/licenses/", + "start_line": 4, + "end_line": 4 + }, + { + "url": "http://www.apache.org/licenses/LICENSE-2.0", + "start_line": 196, + "end_line": 196 + } + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} diff --git a/scanpipe/tests/data/maven/missing_lic_in_package_pid_not_match.json b/scanpipe/tests/data/maven/missing_lic_in_package_pid_not_match.json new file mode 100644 index 0000000000..b0e4e19f7f --- /dev/null +++ b/scanpipe/tests/data/maven/missing_lic_in_package_pid_not_match.json @@ -0,0 +1,153 @@ +{ + "headers": [ + ], + "summary": { + }, + "todo": [ + ], + "packages": [ + { + "type": "maven", + "namespace": "com.google.guava", + "name": "guava", + "version": "33.5.0-jre", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "Guava: Google Core Libraries for Java\nGuava is a suite of core and expanded libraries that include\n utility classes, Google's collections, I/O classes, and\n much more.", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": "https://github.com/google/guava", + "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": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?classifier=sources" + ], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/", + "repository_download_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.jar", + "api_data_url": "https://repo1.maven.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.pom", + "package_uid": "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=xxxxxxxxxxxxxxxxxxxxxx", + "datafile_paths": [ + "codebase/META-INF/maven/com.google.guava/guava/pom.xml" + ], + "datasource_ids": [ + "maven_pom" + ], + "purl": "pkg:maven/com.google.guava/guava@33.5.0-jre" + } + ], + "dependencies": [ + ], + "license_detections": [ + ], + "license_references": [ + ], + "license_rule_references": [ + ], + "files": [ + { + "path": "codebase/META-INF/LICENSE", + "type": "file", + "name": "LICENSE", + "base_name": "LICENSE", + "extension": "", + "size": 11358, + "date": "1980-02-01", + "sha1": "2b8b815229aa8a61e483fb4ba0588b8b6c491890", + "md5": "3b83ef96387f14655fc854ddc3c6bd57", + "sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30", + "sha1_git": "d645695673349e3947e8e5ae42332d0ac3164cd7", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "for_todo": [], + "is_legal": true, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "is_community": false, + "package_data": [], + "for_packages": [ + "pkg:maven/com.google.guava/guava@33.5.0-jre?uuid=351d0e6b-7ee0-4f4a-8450-649bf298d00f" + ], + "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": "codebase/META-INF/LICENSE", + "start_line": 2, + "end_line": 202, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 1584, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "apache-2.0.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/apache-2.0.LICENSE", + "matched_text": " Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.", + "matched_text_diagnostics": "Apache License\n Version 2.0, January 2004\n http://www.apache.org/licenses/\n\n TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n 1. Definitions.\n\n \"License\" shall mean the terms and conditions for use, reproduction,\n and distribution as defined by Sections 1 through 9 of this document.\n\n \"Licensor\" shall mean the copyright owner or entity authorized by\n the copyright owner that is granting the License.\n\n \"Legal Entity\" shall mean the union of the acting entity and all\n other entities that control, are controlled by, or are under common\n control with that entity. For the purposes of this definition,\n \"control\" means (i) the power, direct or indirect, to cause the\n direction or management of such entity, whether by contract or\n otherwise, or (ii) ownership of fifty percent (50%) or more of the\n outstanding shares, or (iii) beneficial ownership of such entity.\n\n \"You\" (or \"Your\") shall mean an individual or Legal Entity\n exercising permissions granted by this License.\n\n \"Source\" form shall mean the preferred form for making modifications,\n including but not limited to software source code, documentation\n source, and configuration files.\n\n \"Object\" form shall mean any form resulting from mechanical\n transformation or translation of a Source form, including but\n not limited to compiled object code, generated documentation,\n and conversions to other media types.\n\n \"Work\" shall mean the work of authorship, whether in Source or\n Object form, made available under the License, as indicated by a\n copyright notice that is included in or attached to the work\n (an example is provided in the Appendix below).\n\n \"Derivative Works\" shall mean any work, whether in Source or Object\n form, that is based on (or derived from) the Work and for which the\n editorial revisions, annotations, elaborations, or other modifications\n represent, as a whole, an original work of authorship. For the purposes\n of this License, Derivative Works shall not include works that remain\n separable from, or merely link (or bind by name) to the interfaces of,\n the Work and Derivative Works thereof.\n\n \"Contribution\" shall mean any work of authorship, including\n the original version of the Work and any modifications or additions\n to that Work or Derivative Works thereof, that is intentionally\n submitted to Licensor for inclusion in the Work by the copyright owner\n or by an individual or Legal Entity authorized to submit on behalf of\n the copyright owner. For the purposes of this definition, \"submitted\"\n means any form of electronic, verbal, or written communication sent\n to the Licensor or its representatives, including but not limited to\n communication on electronic mailing lists, source code control systems,\n and issue tracking systems that are managed by, or on behalf of, the\n Licensor for the purpose of discussing and improving the Work, but\n excluding communication that is conspicuously marked or otherwise\n designated in writing by the copyright owner as \"Not a Contribution.\"\n\n \"Contributor\" shall mean Licensor and any individual or Legal Entity\n on behalf of whom a Contribution has been received by Licensor and\n subsequently incorporated within the Work.\n\n 2. Grant of Copyright License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n copyright license to reproduce, prepare Derivative Works of,\n publicly display, publicly perform, sublicense, and distribute the\n Work and such Derivative Works in Source or Object form.\n\n 3. Grant of Patent License. Subject to the terms and conditions of\n this License, each Contributor hereby grants to You a perpetual,\n worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n (except as stated in this section) patent license to make, have made,\n use, offer to sell, sell, import, and otherwise transfer the Work,\n where such license applies only to those patent claims licensable\n by such Contributor that are necessarily infringed by their\n Contribution(s) alone or by combination of their Contribution(s)\n with the Work to which such Contribution(s) was submitted. If You\n institute patent litigation against any entity (including a\n cross-claim or counterclaim in a lawsuit) alleging that the Work\n or a Contribution incorporated within the Work constitutes direct\n or contributory patent infringement, then any patent licenses\n granted to You under this License for that Work shall terminate\n as of the date such litigation is filed.\n\n 4. Redistribution. You may reproduce and distribute copies of the\n Work or Derivative Works thereof in any medium, with or without\n modifications, and in Source or Object form, provided that You\n meet the following conditions:\n\n (a) You must give any other recipients of the Work or\n Derivative Works a copy of this License; and\n\n (b) You must cause any modified files to carry prominent notices\n stating that You changed the files; and\n\n (c) You must retain, in the Source form of any Derivative Works\n that You distribute, all copyright, patent, trademark, and\n attribution notices from the Source form of the Work,\n excluding those notices that do not pertain to any part of\n the Derivative Works; and\n\n (d) If the Work includes a \"NOTICE\" text file as part of its\n distribution, then any Derivative Works that You distribute must\n include a readable copy of the attribution notices contained\n within such NOTICE file, excluding those notices that do not\n pertain to any part of the Derivative Works, in at least one\n of the following places: within a NOTICE text file distributed\n as part of the Derivative Works; within the Source form or\n documentation, if provided along with the Derivative Works; or,\n within a display generated by the Derivative Works, if and\n wherever such third-party notices normally appear. The contents\n of the NOTICE file are for informational purposes only and\n do not modify the License. You may add Your own attribution\n notices within Derivative Works that You distribute, alongside\n or as an addendum to the NOTICE text from the Work, provided\n that such additional attribution notices cannot be construed\n as modifying the License.\n\n You may add Your own copyright statement to Your modifications and\n may provide additional or different license terms and conditions\n for use, reproduction, or distribution of Your modifications, or\n for any such Derivative Works as a whole, provided Your use,\n reproduction, and distribution of the Work otherwise complies with\n the conditions stated in this License.\n\n 5. Submission of Contributions. Unless You explicitly state otherwise,\n any Contribution intentionally submitted for inclusion in the Work\n by You to the Licensor shall be under the terms and conditions of\n this License, without any additional terms or conditions.\n Notwithstanding the above, nothing herein shall supersede or modify\n the terms of any separate license agreement you may have executed\n with Licensor regarding such Contributions.\n\n 6. Trademarks. This License does not grant permission to use the trade\n names, trademarks, service marks, or product names of the Licensor,\n except as required for reasonable and customary use in describing the\n origin of the Work and reproducing the content of the NOTICE file.\n\n 7. Disclaimer of Warranty. Unless required by applicable law or\n agreed to in writing, Licensor provides the Work (and each\n Contributor provides its Contributions) on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n implied, including, without limitation, any warranties or conditions\n of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n PARTICULAR PURPOSE. You are solely responsible for determining the\n appropriateness of using or redistributing the Work and assume any\n risks associated with Your exercise of permissions under this License.\n\n 8. Limitation of Liability. In no event and under no legal theory,\n whether in tort (including negligence), contract, or otherwise,\n unless required by applicable law (such as deliberate and grossly\n negligent acts) or agreed to in writing, shall any Contributor be\n liable to You for damages, including any direct, indirect, special,\n incidental, or consequential damages of any character arising as a\n result of this License or out of the use or inability to use the\n Work (including but not limited to damages for loss of goodwill,\n work stoppage, computer failure or malfunction, or any and all\n other commercial damages or losses), even if such Contributor\n has been advised of the possibility of such damages.\n\n 9. Accepting Warranty or Additional Liability. While redistributing\n the Work or Derivative Works thereof, You may choose to offer,\n and charge a fee for, acceptance of support, warranty, indemnity,\n or other liability obligations and/or rights consistent with this\n License. However, in accepting such obligations, You may act only\n on Your own behalf and on Your sole responsibility, not on behalf\n of any other Contributor, and only if You agree to indemnify,\n defend, and hold each Contributor harmless for any liability\n incurred by, or claims asserted against, such Contributor by reason\n of your accepting any such warranty or additional liability.\n\n END OF TERMS AND CONDITIONS\n\n APPENDIX: How to apply the Apache License to your work.\n\n To apply the Apache License to your work, attach the following\n boilerplate notice, with the fields enclosed by brackets \"[]\"\n replaced with your own identifying information. (Don't include\n the brackets!) The text should be enclosed in the appropriate\n comment syntax for the file format. We also recommend that a\n file or class name and description of purpose be included on the\n same \"printed page\" as the copyright notice for easier\n identification within third-party archives.\n\n Copyright [yyyy] [name of copyright owner]\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License." + } + ], + "detection_log": [], + "identifier": "apache_2_0-ab23f79b-ec38-9a8a-9b23-85059407f34d" + } + ], + "license_clues": [], + "percentage_of_license_text": 100.0, + "copyrights": [], + "holders": [], + "authors": [], + "emails": [], + "urls": [ + { + "url": "http://www.apache.org/licenses/", + "start_line": 4, + "end_line": 4 + }, + { + "url": "http://www.apache.org/licenses/LICENSE-2.0", + "start_line": 196, + "end_line": 196 + } + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} diff --git a/scanpipe/tests/pipes/test_maven.py b/scanpipe/tests/pipes/test_maven.py new file mode 100644 index 0000000000..e4b3d18454 --- /dev/null +++ b/scanpipe/tests/pipes/test_maven.py @@ -0,0 +1,278 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# http://nexb.com and https://github.com/nexB/scancode.io +# The ScanCode.io software is licensed under the Apache License version 2.0. +# Data generated with ScanCode.io is provided as-is without warranties. +# ScanCode is a trademark of nexB Inc. +# +# You may not use this software except in compliance with the License. +# You may obtain a copy of the License at: http://apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software distributed +# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, either express or implied. See the License for the +# specific language governing permissions and limitations under the License. +# +# Data Generated with ScanCode.io is provided on an "AS IS" BASIS, WITHOUT WARRANTIES +# OR CONDITIONS OF ANY KIND, either express or implied. No content created from +# ScanCode.io should be considered or used as legal advice. Consult an Attorney +# for any legal advice. +# +# ScanCode.io is a free software code scanning tool from nexB Inc. and others. +# Visit https://github.com/nexB/scancode.io for support and download. + +from pathlib import Path +from unittest import mock + +from django.test import TestCase + +from packageurl import PackageURL + +from scanpipe.models import Project +from scanpipe.pipes import maven +from scanpipe.pipes.input import copy_inputs +from scanpipe.pipes.input import load_inventory_from_toolkit_scan + + +class ScanPipeMavenPipesTest(TestCase): + data = Path(__file__).parent.parent / "data" + + @mock.patch("scanpipe.pipes.maven.fetch.fetch_http") + def test_scanpipe_maven_download_pom_file(self, mock_fetch_http): + mock_response = mock.Mock() + mock_response.path = "/safe/example1.pom" + mock_fetch_http.return_value = mock_response + + pom_url = "https://repo1.maven.org/maven2/example/example1.pom" + + expected = { + "pom_file_path": "/safe/example1.pom", + "output_path": "/safe/example1.pom-output.json", + "pom_url": "https://repo1.maven.org/maven2/example/example1.pom", + } + + result = maven.download_pom_file(pom_url) + self.assertEqual(result, expected) + + @mock.patch("scanpipe.pipes.maven.scancode.run_scan") + @mock.patch("builtins.open", new_callable=mock.mock_open) + @mock.patch("json.load") + def test_scanpipe_maven_update_datafile_paths( + self, mock_json_load, mock_open, mock_run_scan + ): + mock_json_load.return_value = { + "packages": [ + { + "name": "example-package", + "version": "1.0.0", + "datafile_paths": ["/safe/mock_pom.xml"], + } + ], + "dependencies": [ + { + "name": "example-dep", + "version": "2.0.0", + "datafile_path": "/safe/mock_pom.xml", + } + ], + } + + pom_file_dict = { + "pom_file_path": "/safe/mock.pom", + "output_path": "/safe/mock.pom-output.json", + "pom_url": "https://repo1.maven.org/maven2/example/example.pom", + } + + expected_packages = [ + { + "name": "example-package", + "version": "1.0.0", + "datafile_paths": [ + "https://repo1.maven.org/maven2/example/example.pom" + ], + } + ] + expected_deps = [ + {"name": "example-dep", "version": "2.0.0", "datafile_path": ""} + ] + + packages, deps = maven.update_datafile_paths(pom_file_dict) + + self.assertEqual(packages, expected_packages) + self.assertEqual(deps, expected_deps) + + def test_scanpipe_maven_get_pom_url(self): + package_url = "pkg:maven/org/apache/commons/commons-lang3@3.12.0" + purl = PackageURL.from_string(package_url) + result = maven.get_pom_url(purl) + expected = "https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.pom" + + self.assertEqual(result, expected) + + def test_scanpipe_maven_update_package_license_from_resource_if_missing(self): + project1 = Project.objects.create(name="Analysis") + input_location = self.data / "maven" / "missing_lic_in_package.json" + project1.copy_input_from(input_location) + copy_inputs(project1.inputs(), project1.codebase_path) + + load_inventory_from_toolkit_scan(project1, str(input_location)) + + for package in project1.discoveredpackages.all(): + self.assertEqual(package.get_declared_license_expression(), "") + + maven.update_package_license_from_resource_if_missing(project1) + + for package in project1.discoveredpackages.all(): + self.assertEqual(package.get_declared_license_expression(), "apache-2.0") + + def test_scanpipe_maven_update_package_license_from_resource_if_missing_no_change( + self, + ): + project1 = Project.objects.create(name="Analysis") + input_location = self.data / "maven" / "lic_in_package.json" + project1.copy_input_from(input_location) + copy_inputs(project1.inputs(), project1.codebase_path) + + load_inventory_from_toolkit_scan(project1, str(input_location)) + + for package in project1.discoveredpackages.all(): + self.assertEqual(package.get_declared_license_expression(), "custom") + + maven.update_package_license_from_resource_if_missing(project1) + + for package in project1.discoveredpackages.all(): + self.assertEqual(package.get_declared_license_expression(), "custom") + + def test_scanpipe_maven_check_input_and_return_purl(self): + project = mock.Mock() + + project.inputsources.all.return_value = ["pkg:maven/a/test@1.0"] + expected = PackageURL(type="maven", namespace="a", name="test", version="1.0") + result = maven.check_input_and_return_purl(project) + self.assertEqual(result, expected) + + def test_scanpipe_maven_check_input_and_return_purl_no_input(self): + project = mock.Mock() + project.inputsources.all.return_value = [] + with self.assertRaisesMessage(ValueError, "Only 1 maven purl is accepted."): + maven.check_input_and_return_purl(project) + + def test_scanpipe_maven_check_input_and_return_purl_multi_input(self): + project = mock.Mock() + project.inputsources.all.return_value = [ + "pkg:maven/a/b@1", + "pkg:maven/a/b@2", + ] + with self.assertRaisesMessage(ValueError, "Only 1 maven purl is accepted."): + maven.check_input_and_return_purl(project) + + def test_scanpipe_maven_check_input_and_return_purl_non_supported_type(self): + project = mock.Mock() + project.inputsources.all.return_value = ["pkg:npm/test@1.0"] + with self.assertRaisesMessage(ValueError, "Only maven purl is supported."): + maven.check_input_and_return_purl(project) + + def test_scanpipe_maven_check_input_and_return_purl_missing_version(self): + project = mock.Mock() + project.inputsources.all.return_value = ["pkg:maven/a/test"] + with self.assertRaisesMessage(ValueError, "Version is required."): + maven.check_input_and_return_purl(project) + + @mock.patch("scanpipe.pipes.maven.fetch_path") + def test_scanpipe_maven_fetch_inputs(self, mock_fetch_path): + purl = PackageURL.from_string("pkg:maven/a/test@1.0") + + mock_fetch_path.side_effect = ["/path/to/binary.jar", "/path/to/source.jar"] + + src_path, bin_path = maven.fetch_inputs(purl) + self.assertEqual(bin_path, "/path/to/binary.jar") + self.assertEqual(src_path, "/path/to/source.jar") + + @mock.patch("scanpipe.pipes.maven.fetch.fetch_url") + def test_scanpipe_maven_fetch_path(self, mock_fetch_url): + url = "https://example.com/package.jar" + + mock_response = mock.Mock() + mock_response.path = "/downloaded/package.jar" + mock_fetch_url.return_value = mock_response + + result = maven.fetch_path(url, "binary") + self.assertEqual(result, "/downloaded/package.jar") + + @mock.patch("builtins.open", new_callable=mock.mock_open) + @mock.patch("json.load") + def test_scanpipe_maven_fetch_and_scan_remote_pom_local_pom_exist( + self, mock_json_load, mock_open + ): + mock_json_load.return_value = { + "files": [{"path": "src/main/pom.xml"}, {"path": "src/main/Main.java"}] + } + result = maven.fetch_and_scan_remote_pom( + "pkg:maven/org/test@1.0", "/path/to/output.json" + ) + self.assertEqual(result, []) + + @mock.patch("builtins.open", new_callable=mock.mock_open) + @mock.patch("json.load") + @mock.patch("scanpipe.pipes.maven.get_pom_url") + def test_scanpipe_maven_fetch_and_scan_remote_pom_no_pom_url( + self, mock_get_pom_url, mock_json_load, mock_open + ): + mock_json_load.return_value = {"files": [{"path": "src/main/Main.java"}]} + mock_get_pom_url.return_value = None + + result = maven.fetch_and_scan_remote_pom( + "pkg:maven/org/test@1.0", "/path/to/output.json" + ) + self.assertEqual( + result, [{"pkg:maven/org/test@1.0": ["Failed to resolve POM URL."]}] + ) + + @mock.patch("builtins.open", new_callable=mock.mock_open) + @mock.patch("json.load") + @mock.patch("scanpipe.pipes.maven.get_pom_url") + @mock.patch("scanpipe.pipes.maven.download_pom_file") + def test_scanpipe_maven_fetch_and_scan_remote_pom_no_pom_file( + self, mock_download_pom_file, mock_get_pom_url, mock_json_load, mock_open + ): + mock_json_load.return_value = {"files": []} + mock_get_pom_url.return_value = "https://example.com/test.pom" + mock_download_pom_file.return_value = {} + + result = maven.fetch_and_scan_remote_pom( + "pkg:maven/org/test@1.0", "/path/to/output.json" + ) + self.assertEqual( + result, + [{"https://example.com/test.pom": ["Failed to download the POM file."]}], + ) + + def test_update_scan_data(self): + original_data = { + "packages": [{"name": "package1"}], + "dependencies": [{"name": "dep1"}], + } + new_package = [{"name": "package2"}] + new_dependency = [{"name": "dep2"}] + + result = maven.update_scan_data(original_data, new_package, new_dependency) + + self.assertEqual( + result["packages"], [{"name": "package1"}, {"name": "package2"}] + ) + self.assertEqual(result["dependencies"], [{"name": "dep1"}, {"name": "dep2"}]) + + @mock.patch("scanpipe.pipes.maven.scancode.run_scan") + def test_scanpipe_maven_scan_pom_file(self, mock_run_scan): + pom_file_dict = { + "pom_file_path": "/main/mock.pom", + "output_path": "/main/mock.pom-output.json", + } + mock_run_scan.return_value = {} + result = maven.scan_pom_file(pom_file_dict) + self.assertEqual(result, {}) + + mock_run_scan.assert_called_once_with( + location="/main/mock.pom", + output_file="/main/mock.pom-output.json", + run_scan_args={"package": True}, + ) diff --git a/scanpipe/tests/test_pipelines.py b/scanpipe/tests/test_pipelines.py index 47122adaf6..442fdea4df 100644 --- a/scanpipe/tests/test_pipelines.py +++ b/scanpipe/tests/test_pipelines.py @@ -612,6 +612,8 @@ class PipelinesIntegrationTest(TestCase): "--verbose", # system_environment differs between systems "system_environment", + # the version number may change over time + "spdx_license_list_version", "file_type", # mime type and is_script are inconsistent across systems "mime_type", @@ -922,6 +924,29 @@ def mock_make_git_directory(**kwargs): self.assertEqual(2, project1.codebaseresources.count()) self.assertEqual(0, project1.discoveredpackages.count()) + @skipIf(sys.platform == "darwin", "Not supported on macOS") + def test_scanpipe_scan_maven_package_single_file(self): + pipeline_name = "scan_maven_package" + project1 = make_project() + + run = project1.add_pipeline(pipeline_name) + pipeline = run.make_pipeline_instance() + + download_url = "pkg:maven/args4j/args4j-tools@2.0.16" + project1.add_input_source(download_url=download_url) + + exitcode, out = pipeline.execute() + self.assertEqual(0, exitcode, msg=out) + + self.assertEqual(41, project1.codebaseresources.count()) + self.assertEqual(1, project1.discoveredpackages.count()) + self.assertEqual(3, project1.discovereddependencies.count()) + self.assertEqual(11, project1.codebaserelations.count()) + + scancode_file = project1.get_latest_output(filename="scancode") + expected_file = self.data / "jvm" / "args4j-tools-2.0.16-sctk.json" + self.assertPipelineResultEqual(expected_file, scancode_file) + def test_scanpipe_scan_codebase_pipeline_integration(self): pipeline_name = "scan_codebase" project1 = make_project()