From 9ea92e30e6aa6e6254d7a9b4e5a9b1f293ff94d9 Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Tue, 8 Aug 2023 17:21:57 +0530 Subject: [PATCH] Add support for custom repository URLs Adds support for getting packages from custom repository URLs, in the case of maven packages. Signed-off-by: Ayan Sinha Mahapatra --- minecode/visitors/maven.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/minecode/visitors/maven.py b/minecode/visitors/maven.py index 023f672a..a662aa14 100644 --- a/minecode/visitors/maven.py +++ b/minecode/visitors/maven.py @@ -302,11 +302,17 @@ def map_maven_package(package_url, package_content): ancestor_pom_texts=ancestor_pom_texts, package=package ) + if "repository_url" in package_url.qualifiers: + base_url = package_url.qualifiers["repository_url"] + else: + base_url = 'https://repo1.maven.org/maven2' + urls = get_urls( namespace=package_url.namespace, name=package_url.name, version=package_url.version, - qualifiers=package_url.qualifiers + qualifiers=package_url.qualifiers, + base_url=base_url, ) # In the case of looking up a maven package with qualifiers of # `classifiers=sources`, the purl of the package created from the pom does