[
https://issues.apache.org/jira/browse/MRESOLVER-273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17610005#comment-17610005
]
ASF GitHub Bot commented on MRESOLVER-273:
------------------------------------------
cstamas commented on code in PR #194:
URL: https://github.com/apache/maven-resolver/pull/194#discussion_r981139587
##########
maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/synccontext/named/StaticNameMapper.java:
##########
@@ -25,24 +25,31 @@
import org.eclipse.aether.RepositorySystemSession;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.metadata.Metadata;
-import org.eclipse.aether.util.ConfigUtils;
/**
* Static {@link NameMapper}, always assigns one same name, effectively
becoming equivalent to "static" sync context:
* always maps ANY input to same name.
*/
public class StaticNameMapper implements NameMapper
{
- /**
- * Configuration property to pass in static name
- */
- private static final String CONFIG_PROP_NAME =
"aether.syncContext.named.static.name";
+ @Override
+ public boolean isFileSystemFriendly()
+ {
+ return true;
+ }
@Override
public Collection<String> nameLocks( final RepositorySystemSession session,
final Collection<? extends Artifact>
artifacts,
final Collection<? extends Metadata>
metadatas )
{
- return Collections.singletonList( ConfigUtils.getString( session,
"static", CONFIG_PROP_NAME ) );
+ if ( ( artifacts != null && !artifacts.isEmpty() ) || ( metadatas !=
null && !metadatas.isEmpty() ) )
+ {
+ return Collections.singletonList( "static" );
+ }
+ else
+ {
+ return Collections.emptyList();
Review Comment:
yup, static misbehaved as for that matter
> Create more compact File locking layout/mapper
> ----------------------------------------------
>
> Key: MRESOLVER-273
> URL: https://issues.apache.org/jira/browse/MRESOLVER-273
> Project: Maven Resolver
> Issue Type: Improvement
> Components: Resolver
> Reporter: Tamás Cservenák
> Assignee: Tamás Cservenák
> Priority: Major
> Fix For: resolver-next
>
>
> Current FileGAVNameMapper "mimics" loosely local reposiory layout, uses long
> paths, hence (relatively) big strings etc.
> More compact layout would be just to hash strings like "a:G:A:V" and
> "m:G[:A[:V]]" for artifacts and metadata instead, and create 2 level deep
> hashed storage.
> Problem with "loose" layout is that they do end up as files in OS, while
> these would be much shorter.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)