Skip to content

Conversation

@bigdaz
Copy link
Member

@bigdaz bigdaz commented Jul 8, 2023

The maven central repo (https://repo.maven.apache.org/m2) is the default repository URL for any maven PURLs.
For dependencies resolved from Maven central, a repository_url value is no longer included in the generated PURL.

Fixes #43

The maven central repo (https://repo.maven.apache.org/m2) is the default
repository URL for any maven PURLs.
For dependencies resolved from Maven central, a repository_url value is no
longer included in the generated PURL.
def repositoryUrl = mavenRepo.rootDir.toURI().toASCIIString()
// Remove trailing '/' to be consistent with production code
if (repositoryUrl.endsWith("/")) {
repositoryUrl = repositoryUrl.substring(0, repositoryUrl.length() - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Would dropRight(1) work here instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Much better, thanks

@bigdaz bigdaz merged commit d2bc77f into main Jul 8, 2023
@bigdaz bigdaz deleted the dd/package_url branch July 8, 2023 12:47
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.

Omit the default repository_url from Maven PURLs

3 participants