Skip to content

Commit

Permalink
Add support for custom repository URLs
Browse files Browse the repository at this point in the history
Adds support for getting packages from custom repository URLs,
in the case of maven packages.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
  • Loading branch information
AyanSinhaMahapatra committed Aug 8, 2023
1 parent c775297 commit 9ea92e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion minecode/visitors/maven.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ea92e3

Please sign in to comment.