Interface RepositoryAwareRequest
- All Known Subinterfaces:
ArtifactResolverRequest,DependencyResolverRequest,ModelBuilderRequest,ProjectBuilderRequest,VersionRangeResolverRequest,VersionResolverRequest
Implementations of this interface can specify a list of remote repositories to be used during the operation. If no repositories are specified (null), the session's default remote repositories will be used. The repositories are validated to ensure they don't contain duplicates or null entries.
Remote repositories are used for:
- Resolving artifacts and their metadata
- Downloading parent POMs and dependency POMs
- Retrieving version information and ranges
- Accessing plugin artifacts and their dependencies
Repository validation ensures data integrity by:
- Preventing duplicate repositories that could cause confusion
- Rejecting null repository entries that would cause failures
- Maintaining consistent repository ordering for reproducible builds
- Since:
- 4.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the list of remote repositories to be used for this request.default List<RemoteRepository> validate(List<RemoteRepository> repositories) Validates a list of remote repositories to ensure data integrity.
-
Method Details
-
getRepositories
Returns the list of remote repositories to be used for this request.If this method returns
null, the session's default remote repositories will be used. If a non-null list is returned, it will be used instead of the session's repositories, allowing for request-specific repository configuration.The returned list should not contain duplicate repositories (based on their equality) or null entries, as these will cause validation failures when the request is processed.
- Returns:
- the list of remote repositories to use, or
nullto use session defaults - See Also:
-
validate
Validates a list of remote repositories to ensure data integrity.This method performs the following validations:
- Allows null input (returns null)
- Ensures no duplicate repositories exist in the list
- Ensures no null repository entries exist in the list
Duplicate detection is based on the
RemoteRepository#equals(Object)method, which typically compares repository IDs and URLs.- Parameters:
repositories- the list of repositories to validate, may benull- Returns:
- the same list if validation passes, or
nullif input wasnull - Throws:
IllegalArgumentException- if the list contains duplicate repositoriesIllegalArgumentException- if the list contains null repository entries
-