Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
9e93317
Add "scan_maven_package" pipeline (Working-in-progress) #1763
chinyeungli Nov 12, 2025
928f742
Use pom_url as the datafile_path for the dependenies #1763
chinyeungli Nov 13, 2025
d63a1e5
Use empty string for datafile_path in dependencies #1763
chinyeungli Nov 13, 2025
9812129
Removed dup code that's already present in ScanSinglePackage #1763
chinyeungli Nov 13, 2025
114eb75
Update the matching regex for parse_maven_filename and added test #1763
chinyeungli Nov 13, 2025
13e8e88
Refactor code and add tests #1763
chinyeungli Nov 14, 2025
cb623c1
Implement "update_package_license_from_resource_if_missing" function …
chinyeungli Nov 17, 2025
b937cff
Only work with "maven" package type #1763
chinyeungli Nov 18, 2025
0bbe979
Update docstring description #1763
chinyeungli Nov 18, 2025
2b3c9bb
Add test for the "scan_maven_package" pipeline #1763
chinyeungli Nov 18, 2025
9a11dd8
Fix the Incomplete URL substring sanitization #1763
chinyeungli Nov 18, 2025
f303430
Add "maven.google.com" as a maven_hosts and accept .aar file #1763
chinyeungli Nov 19, 2025
ab71751
Reorganize code structure and code enhancement #1763
chinyeungli Nov 26, 2025
5579db8
Update build-in-pipelines.rst #1763
chinyeungli Nov 26, 2025
9ed4c2d
Merge remote-tracking branch 'origin/main' into 1763_pipeline_for_maven
chinyeungli Dec 22, 2025
12728e4
Added steps to handle D2D in the maven pipeline #1763
chinyeungli Dec 29, 2025
3242b16
Update "exclude_from_diff" list #1763
chinyeungli Dec 29, 2025
97a109b
Ruff reformatted #1763
chinyeungli Dec 29, 2025
9992d15
Update class description #1763
chinyeungli Dec 29, 2025
4f1b4d3
Error handling if pom url not found #1763
chinyeungli Dec 31, 2025
6fffa2c
Prevent duplicate CodebaseRelation entries #1763
chinyeungli May 25, 2026
ee673f1
Update minecode pipelines with stable release v0.1.1 (#2013)
AyanSinhaMahapatra Dec 26, 2025
257560c
Fix typos in docstrings for pathmap.py (#1985)
pranavkeerti66-hue Dec 26, 2025
3124455
Store the whole vulnerability data from cdx to local models (#2007)
tdruez Dec 26, 2025
9e2b2bc
Add project vulnerability list view (#2018)
tdruez Dec 29, 2025
c602e9d
feat: Improve class file mapping #2021
chinyeungli Jan 5, 2026
3bd3112
Update index.rst with new structure
DennisClark Dec 31, 2025
395a906
Fix index page issues
AyanSinhaMahapatra Jan 5, 2026
6b03c2d
Update README.rst to improve structure
DennisClark Jan 16, 2026
aeb6f3c
Update to scancode-toolkit v32.5.0 (#2000)
AyanSinhaMahapatra Jan 22, 2026
1602d6a
exclude github folder from deploy resource
Aryan-SINGH-GIT Dec 18, 2025
5406ece
removing unnecessary git stat
Aryan-SINGH-GIT Dec 18, 2025
96535de
reformat file
Aryan-SINGH-GIT Dec 18, 2025
d09aa27
adding github in deployed_resource_path_exclusions
Aryan-SINGH-GIT Dec 18, 2025
e0d7391
chore: upgrade django to version 6.x (#2052)
tdruez Feb 12, 2026
bdc592c
fix: upgrade python in the rtd config file (#2053)
tdruez Feb 12, 2026
7d23536
Match MacOS binary symbols to Go TypeScript symbols (#2056)
AyanSinhaMahapatra Feb 19, 2026
706dbe5
Bump android_inspector to v0.2.0 (#2069)
keshav-space Feb 26, 2026
0adfb1e
chore: automatically closes low-quality and AI slop PRs (#2072)
tdruez Mar 2, 2026
c9be588
chore: upgrade RQ, Redis, and more to their latest version (#2073)
tdruez Mar 2, 2026
3387a47
chore: upgrade Django and Redis to their latest version
tdruez Mar 8, 2026
ac1331a
fix: failing test by updating the expectation fixture (#2084)
tdruez Mar 9, 2026
621d890
chore: upgrade Django to latest version (#2085)
tdruez Mar 9, 2026
2216bf2
feat: remove the chown service in compose file (#2086)
tdruez Mar 9, 2026
e541b86
fix: URL-encode programming language filter values in resource list (…
uttam282005 Mar 9, 2026
492b693
fix: rename "Grammar" optional step group to "Antlr" in d2d pipeline …
Monal-Reddy Mar 9, 2026
1f1e74c
feat!: replace plain-text DRF token with PBKDF2-hashed API token (#2087)
tdruez Mar 11, 2026
beb1807
chore: set explicit workflow permissions and pin down actions (#2090)
tdruez Mar 11, 2026
13ab091
chore: bump version to v37.0.0 for release (#2091)
tdruez Mar 11, 2026
edf44da
fix: add the checkout step to pypi release workflow
tdruez Mar 11, 2026
44371f6
chore: refine gh workflows for security and consistency
tdruez Mar 11, 2026
40e45a5
feat: display scio and toolkit versions in place of django version (#…
tdruez Mar 16, 2026
cf25704
fix missing space in scan_max_file_size help text (#2097)
rishabh23rohil Mar 16, 2026
e13b78f
feat: add tests for chunked and get_purls utilities (#2100)
rishabh23rohil Mar 16, 2026
85ea093
feat: display layers information (created_by, comment) in tree view (…
tdruez Mar 16, 2026
0cd684f
feat: enhance the global HTML structure (#2103)
tdruez Mar 17, 2026
e1a47cd
feat: remove the need for context processor and improve base template…
tdruez Mar 18, 2026
827b545
chore: remove the PR quality workflow
tdruez Mar 25, 2026
c8f0707
chore: upgrade the scancode-action to latest version (pinned deps) (#…
tdruez Mar 27, 2026
925cd15
fix: XSS and duplicate file detection in file upload UI (#2129)
tdruez Mar 30, 2026
b5298f7
fix: incomplete URL sanitization for Slack webhook detection (#2130)
tdruez Mar 30, 2026
6e04d0e
chore: correct typo in `pipes/clamav` (#2121)
OmAnand857 Mar 30, 2026
5110b1f
feat: is_safe_url to mitigate SSRF in URL requests (#2131)
tdruez Mar 30, 2026
9582fb6
feat: add search to resource tree (#2114)
aayushkdev Mar 30, 2026
500fdcf
feat: enhance tree search rendering and implementation (#2133)
tdruez Mar 30, 2026
b10d157
feat: use uv and uv.lock for reproducible builds in Docker image (#2134)
tdruez Apr 1, 2026
5ed4a74
fix: add support for sqlite in the apitoken data migration (#2138)
tdruez Apr 1, 2026
56db41d
feat!: convert Dockerfile to multi-stage build (#2139)
tdruez Apr 1, 2026
47a761f
chore: bump version to v37.1.0 for release (#2140)
tdruez Apr 1, 2026
62dc6a1
chore: upgrade scancode-action to docker base v0.1 release (#2141)
tdruez Apr 2, 2026
d120a2d
feat: add "base" Docker build stage (#2142)
tdruez Apr 3, 2026
5c63602
fix: fallback to license_declared when loading SPDX SBOM (#2144)
tdruez Apr 3, 2026
21722fb
feat!: Switch development workflow from local venv to Docker Compose …
tdruez Apr 10, 2026
7c6c343
fix: relax validation for non-HTTP URLs (#2147)
tdruez Apr 13, 2026
dc151c4
fix: load the .env in the Docker dev compose (#2149)
tdruez Apr 14, 2026
eb1a3ab
chore: upgrade Django and cryptography to latest version (#2150)
tdruez Apr 14, 2026
fedf5ad
fix: replace the hardcoded /var/www/html by named volume (#2160)
tdruez May 11, 2026
d3f82a2
chore: bump minecode-pipelines version to 1.0.0 (#2170)
JonoYang May 19, 2026
39ac66f
chore: update minecode-pipelines version to 1.0.1 (#2171)
JonoYang May 19, 2026
d34bda9
Install Java and jadx in Dockerfile #1812 (#2174)
JonoYang Jun 12, 2026
c3a0797
chore: upgrade dependencies (#2173)
tdruez Jun 12, 2026
4e7401c
chore: bump version to v37.2.0 for release (#2175)
tdruez Jun 12, 2026
16ffc08
fix: add setup-buildx step to enable GHA cache support (#2176)
tdruez Jun 15, 2026
cfde610
fix: add latest-full tag and OCI annotations to Docker publish workflow
tdruez Jun 15, 2026
13d7d2a
Change the text files #1763
chinyeungli Jun 21, 2026
6de4ecf
Merge branch 'main' into 1763_pipeline_for_maven
chinyeungli Jun 29, 2026
2af1275
Removed "def dependency_count(self):" that's removed in current main …
chinyeungli Jun 29, 2026
edcdc35
chore: refine dev compose file
tdruez Jun 30, 2026
f9c8f68
feat: render the compliance alert value as a colored label (#2186)
tdruez Jun 30, 2026
8f6fcb8
feat: add pipeline availability check with disabled state in UI (#2188)
tdruez Jul 1, 2026
2abcc07
feat: replace django-taggit with a plain Project.labels JSONField (#2…
tdruez Jul 2, 2026
263275e
feat: move scanpipe settings to local settings.py with lazy resolutio…
tdruez Jul 9, 2026
60e9098
fix: ClamAV scan crash on codebase root directory (#2190)
tdruez Jul 9, 2026
5c1f7f4
chore: upgrade vulnerable dependencies (#2191)
tdruez Jul 9, 2026
e26b3ae
Refactor code structure for Maven pipeline #1763
chinyeungli Jul 14, 2026
c77c169
Add more comments #1763
chinyeungli Jul 14, 2026
52eaf65
Add the missing import settings #1763
chinyeungli Jul 14, 2026
8514b77
Merge branch 'main' into 1763_pipeline_for_maven
chinyeungli Jul 14, 2026
4066b85
Add the missing import settings #1763
chinyeungli Jul 14, 2026
a7cadde
Update tests #1763
chinyeungli Jul 14, 2026
9516d88
Skip test_scanpipe_scan_maven_package_single_file on macos #1763
chinyeungli Jul 14, 2026
f018823
Better code organization #1763
chinyeungli Jul 15, 2026
8e83344
Remove non-used code #1763
chinyeungli Jul 15, 2026
131f84b
Restore license notice and code enhancement #1763
chinyeungli Jul 16, 2026
f3401de
Apply suggestion from @tdruez
chinyeungli Jul 16, 2026
96b9334
Code enhancement based on the PR review comments #1763
chinyeungli Jul 16, 2026
2631c80
Better code structure and added tests #1763
chinyeungli Jul 17, 2026
91120ae
Clean up code and improve formatting #1763
chinyeungli Jul 20, 2026
f2a7e3b
Update scanpipe/pipes/maven.py
chinyeungli Jul 20, 2026
f479350
Re-order the pipelines order #1763
chinyeungli Jul 22, 2026
90c71dd
Refactor Maven pipeline for error handling and performance #1763
chinyeungli Jul 23, 2026
62a29ac
Fix code/doc formatting #1763
chinyeungli Jul 23, 2026
895b1ce
Use PurePosixPath for file checking #1763
chinyeungli Jul 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/built-in-pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Comment thread
chinyeungli marked this conversation as resolved.
scan_single_package = "scanpipe.pipelines.scan_single_package:ScanSinglePackage"

[tool.setuptools.packages.find]
Expand Down
185 changes: 185 additions & 0 deletions scanpipe/pipelines/scan_maven_package.py
Original file line number Diff line number Diff line change
@@ -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):
Comment thread
tdruez marked this conversation as resolved.
"""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)
2 changes: 1 addition & 1 deletion scanpipe/pipes/d2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Loading
Loading