cstamas commented on code in PR #2135:
URL: https://github.com/apache/maven-resolver/pull/2135#discussion_r3993819128
##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/checksum/FileTrustedChecksumsSourceSupport.java:
##########
@@ -193,21 +183,24 @@ protected Path getBasedir(
}
/**
- * Returns repository key to be used on file system layout.
+ * Returns repository keys to be used on file system layout. Always
returns a list with at least one element.
+ * Elements are sorted from "most specific" to "least specific" keys.
*
* @since 2.0.14
*/
- protected String repositoryKey(RepositorySystemSession session,
ArtifactRepository artifactRepository) {
+ protected List<String> repositoryKey(RepositorySystemSession session,
ArtifactRepository artifactRepository) {
+ ArrayList<String> keys = new ArrayList<>();
if (artifactRepository instanceof RemoteRepository) {
- return repositoryKeyFunctionFactory
- .repositoryKeyFunction(
- FileTrustedChecksumsSourceSupport.class,
- session,
- DEFAULT_REPOSITORY_KEY_FUNCTION,
- CONFIG_PROP_REPOSITORY_KEY_FUNCTION)
- .apply((RemoteRepository) artifactRepository, null);
+ RemoteRepository rr = (RemoteRepository) artifactRepository;
+ keys.add(repositoryKeyFunctionFactory
Review Comment:
It was documented as "experimental", and artifact paths are not affected by
this change (their filename is not repoKey dependant).
##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/filter/RemoteRepositoryFilterSourceSupport.java:
##########
@@ -111,18 +102,22 @@ protected RemoteRepository normalizeRemoteRepository(
}
/**
- * Returns repository key to be used on file system layout.
+ * Returns repository keys to be used on file system layout for user
provided files. They are ordered as
+ * "most specific" (using {@link
RepositoryKeyFunctionFactory#trackingRepositoryKeyFunction(RepositorySystemSession)})
+ * to simple "id based" one. This allows user to keep using plain ID, but
also to provide very narrowly targeted
+ * input files, when needed.
*
* @since 2.0.14
*/
- protected String repositoryKey(RepositorySystemSession session,
RemoteRepository repository) {
- return repositoryKeyFunctionFactory
- .repositoryKeyFunction(
- RemoteRepositoryFilterSourceSupport.class,
- session,
- DEFAULT_REPOSITORY_KEY_FUNCTION,
- CONFIG_PROP_REPOSITORY_KEY_FUNCTION)
- .apply(repository, null);
+ protected List<String> repositoryKeys(RepositorySystemSession session,
RemoteRepository repository) {
+ ArrayList<String> keys = new ArrayList<>();
+ keys.add(repositoryKeyFunctionFactory
+ .trackingRepositoryKeyFunction(session)
+ .apply(repository, null));
Review Comment:
It was documented as "experimental", and artifact paths are not affected by
this change (their filename is not repoKey dependant).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]