Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't use pom.distributionManagement.repository.url for BOM #239

Merged
merged 1 commit into from
Dec 24, 2022

Conversation

hboutemy
Copy link
Contributor

BOM requires url to download component, pom.dM.repository is for publication (e.g. OSSRH for Maven Central)

Signed-off-by: Hervé Boutemy hboutemy@apache.org

For example, commons-compress 1.12 BOM point distribution to https://repository.apache.org/service/local/staging/deploy/maven2 which is the staging area to publish to Maven Central from Apache Software Foundation

BOM requires url to download component, pom.dM.repository is for
publication (e.g. OSSRH for Maven Central)

Signed-off-by: Hervé Boutemy <hboutemy@apache.org>
@stevespringett stevespringett merged commit afd3012 into CycloneDX:master Dec 24, 2022
@stevespringett
Copy link
Member

@hboutemy Actually, I'm not sure this should have been merged. In CycloneDX, a distribution is the location where the artifact can be retrieved from. It forms the basis of provenance. So having Maven Central, etc, is what is expected.

@stevespringett
Copy link
Member

We need to support this use case, but while ignoring snapshot repos if the artifact is not a snapshot.

@stevespringett
Copy link
Member

I guess the confusion on my part is the difference between getDownloadUrl (which is currently still in the codebase) and getRepository, which is what was removed in this PR.

@stevespringett
Copy link
Member

I'm going to revert this PR. For the overwhelming majority of artifacts deployed to Central, the distribution URL will be that of Maven Central. I think ASF (and possibly a few others) are unique in that they have dedicated staging environments. We cannot cripple this functionality for the majority of artifacts for the benefit of a few.

Perhaps we can include a workaround. Possibilities include:

  • Replace https://repository.apache.org/service/local/staging/deploy/maven with https://repo1.maven.org/maven2.
  • When https://repository.apache.org/service/local/staging/deploy/maven is encountered, add an additional distribution to https://repo1.maven.org/maven2 resulting in BOTH being present. This is technically more accurate.
  • Create a configuration that would allow users to specify the distribution base URL

@hboutemy
Copy link
Contributor Author

pom.distributionManagement.repository.url is never the url to download: for Maven Central when ussing OSSRH, it's https://s01.oss.sonatype…l/staging/deploy/maven2/ (see for example https://repo1.maven.org/maven2/io/dropwizard/dropwizard-project/4.0.0-beta.3/dropwizard-project-4.0.0-beta.3-cyclonedx.json)

reverting just adds back a value that has no interest

there is no info in Maven pom.xml or runtime to know the public url (at runtime, you'll get a local repository manager url if the user uses one)

if you really want to provide a download url for Maven Central (or any other Maven-format repository), it will require a cyclonedx-maven-plugin additional parameter

@EstherOnly
Copy link

After we upgrade this plugin, our project doesn't run well, I wish we can use pom.distributionManagement.repository.url, now I have rollback the version to 2.7.3

@hboutemy
Copy link
Contributor Author

@EstherOnly can you define "our project doesn't run well", please?

notice that this PR has been reverted in #244 , then I don't see what has changed for you regarding this url

ideally, please open a separate issue describing your problem so we can track it more easily

@EstherOnly
Copy link

EstherOnly commented Mar 12, 2023 via email

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