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

feat(java): add support for fetching packages from repos mentioned in pom.xml #6171

Merged
merged 6 commits into from
Feb 22, 2024

Conversation

renypaul
Copy link
Contributor

@renypaul renypaul commented Feb 21, 2024

Description

This change allows packages to be fetched from repository other than https://repo.maven.apache.org/maven2/

Get username and password from settings file for the corresponding server ID mentioned in the pom file Added support for authentication if username and password mentioned while fetching the package

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Description
This change allows packages to be fetched from repository other than https://repo.maven.apache.org/maven2/

Get username and password from settings file for the corresponding server ID mentioned in the pom file
Added support for authentication if username and password mentioned while fetching the package
@renypaul renypaul requested a review from knqyf263 as a code owner February 21, 2024 06:19
@renypaul renypaul changed the title Add support for fetching packages repos mentioned in pom.xml feat(pom) add support for fetching packages from repos mentioned in pom.xml Feb 21, 2024
@renypaul renypaul changed the title feat(pom) add support for fetching packages from repos mentioned in pom.xml feat(java) add support for fetching packages from repos mentioned in pom.xml Feb 21, 2024
@DmitriyLewen DmitriyLewen changed the title feat(java) add support for fetching packages from repos mentioned in pom.xml feat(java): add support for fetching packages from repos mentioned in pom.xml Feb 21, 2024
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

@renypaul I refactor a bit.
Also i found that we added repos for each pom file(see my comment).

Can you take a look?

pkg/dependency/parser/java/pom/parse.go Outdated Show resolved Hide resolved
  - Added comments where there credentials are fetched
  - Updated the order of the repo to reduce the number of tries to fetch
  - Avoid fetching pom file without version, since it will anyways fail in the tries
Copy link
Collaborator

@knqyf263 knqyf263 left a comment

Choose a reason for hiding this comment

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

LGTM, but @DmitriyLewen has more insights. I'd defer to him.

Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

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

@renypaul Thanks for your work!

LGTM.
@knqyf263 I approved this PR.

@renypaul
Copy link
Contributor Author

Thanks @DmitriyLewen @knqyf263

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