From 113c775be0d7af569ddca82bcffe085ef56d5279 Mon Sep 17 00:00:00 2001 From: Rui Han Date: Thu, 28 Nov 2024 13:43:36 +0800 Subject: [PATCH] Add checkMask in maven metadata generator downloadMissing (#2482) --- .../indy/pkg/maven/content/MavenMetadataGenerator.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/pkg-maven/common/src/main/java/org/commonjava/indy/pkg/maven/content/MavenMetadataGenerator.java b/addons/pkg-maven/common/src/main/java/org/commonjava/indy/pkg/maven/content/MavenMetadataGenerator.java index 01cae89153..49f92a46a2 100644 --- a/addons/pkg-maven/common/src/main/java/org/commonjava/indy/pkg/maven/content/MavenMetadataGenerator.java +++ b/addons/pkg-maven/common/src/main/java/org/commonjava/indy/pkg/maven/content/MavenMetadataGenerator.java @@ -92,6 +92,7 @@ import static org.commonjava.atlas.maven.ident.util.SnapshotUtils.LOCAL_SNAPSHOT_VERSION_PART; import static org.commonjava.atlas.maven.ident.util.SnapshotUtils.generateUpdateTimestamp; import static org.commonjava.atlas.maven.ident.util.SnapshotUtils.getCurrentTimestamp; +import static org.commonjava.indy.core.content.PathMaskChecker.checkMask; import static org.commonjava.indy.core.content.PathMaskChecker.checkMavenMetadataMask; import static org.commonjava.indy.core.content.group.GroupMergeHelper.GROUP_METADATA_EXISTS; import static org.commonjava.indy.core.content.group.GroupMergeHelper.GROUP_METADATA_GENERATED; @@ -856,8 +857,13 @@ private Callable downloadMissing( ArtifactStore store, String to try { logger.trace( "Starting metadata download: {}:{}", store.getKey(), toMergePath ); + if ( !checkMask( store, toMergePath ) ) + { + logger.debug( "Transfer {}:{} skipped due to checkMask during maven metadata generator downloadMissing.", + store.getKey(), toMergePath ); + return null; + } Transfer memberMetaTxfr = fileManager.retrieveRaw( store, toMergePath, new EventMetadata() ); - if ( exists( memberMetaTxfr ) ) { final MetadataXpp3Reader reader = new MetadataXpp3Reader();