cstamas commented on code in PR #1610:
URL: https://github.com/apache/maven-resolver/pull/1610#discussion_r2401351933
##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/synccontext/named/GAVNameMapper.java:
##########
@@ -103,18 +104,46 @@ private static String getArtifactName(Artifact artifact,
String prefix, String s
+ suffix;
}
+ private static final String MAVEN_METADATA = "maven-metadata.xml";
+
private static String getMetadataName(Metadata metadata, String prefix,
String separator, String suffix) {
- String name = prefix;
- if (!metadata.getGroupId().isEmpty()) {
- name += metadata.getGroupId();
- if (!metadata.getArtifactId().isEmpty()) {
- name += separator + metadata.getArtifactId();
- if (!metadata.getVersion().isEmpty()) {
- name += separator + metadata.getVersion();
+ if (metadata.getType().contains("/")) {
+ String metadataType = metadata.getType();
+ int slash = metadataType.indexOf('/');
+ return metadataType.substring(0, slash)
Review Comment:
And to answer your original question "we put the first part of the metadata
in front"... due local repository layout. If I ask from Central following
metadata:
* `Metadata(G:"", A:"", V:"", Type:"prefixes.txt")`
* `Metadata(G:"", A:"", V:"", Type:".meta/prefixes.txt")`
* `Metadata(G:"", A:"", V:"", Type:".meta/meta/prefixes.txt")`
They would call conflict, as Resolver handles Metadata file names in local
repository by appending origin repoId, so they would be locally then be named
`prefix-$repoId.txt` and clash.
Oh, but you are right, these are local repo paths, and we talk about _lock
names_. Yes, you are right, we could replace `/` to `_` or anything to keep
them "flat", agreed.
--
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]