-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(java): add support remote repositories from settings.xml files #9708
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
base: main
Are you sure you want to change the base?
feat(java): add support remote repositories from settings.xml files #9708
Conversation
- remove pomRepositories struct - rename resolvePomRepos
|
Hello @ricardo-kh, It would be great if you have some time to check and test the updates. |
📊 API Changes DetectedSemver impact: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for Maven repository definitions from settings.xml files, following Maven's repository resolution order. The changes enable proper handling of profiles and repositories defined in user-level and global settings files, with credential integration and correct repository prioritization.
Key changes:
- Added repository parsing from Maven settings.xml profiles with support for activeByDefault and activeProfiles activation
- Implemented Maven-compliant repository resolution order (settings → pom → default) with reverse ordering for settings repositories
- Refactored repository handling to use a unified repository struct with type-safe handling of release/snapshot enablement
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/dependency/parser/java/pom/settings.xml (user) | Adds test profile with repository definitions and activation settings |
| pkg/dependency/parser/java/pom/settings.xml (env placeholders) | Adds test profile with environment variable placeholders for repository configuration |
| pkg/dependency/parser/java/pom/settings.xml (global) | Adds multiple test profiles with repository definitions including activeByDefault profile |
| pkg/dependency/parser/java/pom/example-api-1.7.30.pom | New test fixture POM for validating repository resolution from settings |
| pkg/dependency/parser/java/pom/settings_test.go | Adds comprehensive tests for settings parsing and effective repository resolution |
| pkg/dependency/parser/java/pom/settings.go | Implements effectiveRepositories method and profile/repository merging logic |
| pkg/dependency/parser/java/pom/repository.go | New file extracting repository resolution logic into unified structure |
| pkg/dependency/parser/java/pom/pom.go | Refactors repository handling to use new unified repository struct |
| pkg/dependency/parser/java/pom/parse_test.go | Adds test for multiple repository usage with settings repositories |
| pkg/dependency/parser/java/pom/parse.go | Updates Parser to use repositories struct and implement correct resolution order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Description
This PR enhances the Maven POM parser to properly handle repository definitions from Maven settings.xml files, implementing the correct repository resolution order according to Maven specifications. The changes introduce support for
profiles and repositories defined in both user-level and global settings files, with proper credential handling and repository prioritization.
Key changes include:
Reasons for Change
Nuances
Related issues
settings.xmlforpom.xmlfiles #7807Related PRs
settings.xmlforpom.xmlfiles #9159Checklist