Skip to content

Conversation

@fafanoulele
Copy link
Contributor

Add Maven support e.g.:

> purl2url.get_repo_url("pkg:maven/org.apache.commons/commons-io@1.3.2")
"https://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2"

> purl2url.get_download_url("pkg:maven/org.apache.commons/commons-io@1.3.2")
"https://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.jar"

@pombredanne
Copy link
Member

@fafanoulele Thanks. The thing may be a bit more complex for JARs because of the many "artefacts" available for a given version....

@pombredanne
Copy link
Member

See also #179 (comment)

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Here is some feedback for your consideration.

@pombredanne
Copy link
Member

You may also want to check this by @robertguetzkow aboutcode-org/dejacode#256 (comment)

I would also suggest using resolved URLs as the basis when they are already included in the SBOM and identifiable, instead of relying on purl2url which might not work for every package manager.

@fafanoulele
Copy link
Contributor Author

@fafanoulele Thanks. The thing may be a bit more complex for JARs because of the many "artefacts" available for a given version....

I've added support for type and classifier as qualifiers e.g.:

> purl2url.get_download_url("pkg:maven/org.apache.commons/commons-io@1.3.2?type=pom")
"https://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.pom"

> purl2url.get_download_url("pkg:maven/org.apache.commons/commons-io@1.3.2?classifier=arbitrary")
"https://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2-arbitrary.jar"

Copy link
Collaborator

@tdruez tdruez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fafanoulele Thanks for this contribution! I've made a few simplifications.
Ready for merge!

@tdruez tdruez merged commit c42e618 into package-url:main Jun 5, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants