Prefer namespaced metadata when duplicates are found
This commit is contained in:
parent
92bb6d7e3e
commit
c999df5760
@ -0,0 +1,59 @@
|
||||
From a4d655c2537eaffe0a3031243427cfdfd480a450 Mon Sep 17 00:00:00 2001
|
||||
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
||||
Date: Fri, 28 Jun 2019 12:15:23 +0200
|
||||
Subject: [PATCH] Prefer namespaced metadata when duplicates are found
|
||||
|
||||
---
|
||||
.../metadata/impl/DefaultMetadataResult.java | 33 +++++++++++--------
|
||||
1 file changed, 19 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/xmvn-core/src/main/java/org/fedoraproject/xmvn/metadata/impl/DefaultMetadataResult.java b/xmvn-core/src/main/java/org/fedoraproject/xmvn/metadata/impl/DefaultMetadataResult.java
|
||||
index c8b63214..67bafef5 100644
|
||||
--- a/xmvn-core/src/main/java/org/fedoraproject/xmvn/metadata/impl/DefaultMetadataResult.java
|
||||
+++ b/xmvn-core/src/main/java/org/fedoraproject/xmvn/metadata/impl/DefaultMetadataResult.java
|
||||
@@ -94,23 +94,28 @@ class DefaultMetadataResult
|
||||
}
|
||||
|
||||
ArtifactMetadata otherMetadata = artifactMap.get( artifact );
|
||||
- if ( otherMetadata != null )
|
||||
+
|
||||
+ if ( otherMetadata == null )
|
||||
+ {
|
||||
+ artifactMap.put( artifact, metadata );
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ duplicateArtifacts.add( artifact );
|
||||
+
|
||||
+ if ( ignoreDuplicates )
|
||||
{
|
||||
- duplicateArtifacts.add( artifact );
|
||||
-
|
||||
- if ( ignoreDuplicates )
|
||||
- {
|
||||
- artifactMap.remove( artifact );
|
||||
- logger.warn( "Ignoring metadata for artifact {} as it has duplicate metadata", artifact );
|
||||
- continue;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- logger.warn( "Duplicate metadata for artifact {}", artifact );
|
||||
- }
|
||||
+ artifactMap.remove( artifact );
|
||||
+ logger.warn( "Ignoring metadata for artifact {} as it has duplicate metadata", artifact );
|
||||
+ continue;
|
||||
}
|
||||
|
||||
- artifactMap.put( artifact, metadata );
|
||||
+ logger.warn( "Duplicate metadata for artifact {}", artifact );
|
||||
+
|
||||
+ if ( otherMetadata.getNamespace().isEmpty() || !metadata.getNamespace().isEmpty() )
|
||||
+ {
|
||||
+ artifactMap.put( artifact, metadata );
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Name: xmvn
|
||||
Version: 3.1.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: Local Extensions for Apache Maven
|
||||
License: ASL 2.0
|
||||
URL: https://fedora-java.github.io/xmvn/
|
||||
@ -13,6 +13,8 @@ BuildArch: noarch
|
||||
|
||||
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
|
||||
|
||||
Patch1: 0001-Prefer-namespaced-metadata-when-duplicates-are-found.patch
|
||||
|
||||
BuildRequires: maven >= 3.5.0
|
||||
BuildRequires: maven-local
|
||||
BuildRequires: apache-commons-compress
|
||||
@ -182,6 +184,7 @@ This package provides %{summary}.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
|
||||
# Bisect IT has no chances of working in local, offline mode, without
|
||||
# network access - it needs to access remote repositories.
|
||||
@ -322,6 +325,9 @@ cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
|
||||
%doc LICENSE NOTICE
|
||||
|
||||
%changelog
|
||||
* Fri Jun 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.0-2
|
||||
- Prefer namespaced metadata when duplicates are found
|
||||
|
||||
* Fri Jun 14 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.0-1
|
||||
- Update to upstream version 3.1.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user