From 5133f2f17beec0a3894f6c4b194f23c88579510a Mon Sep 17 00:00:00 2001 From: Fabian Recktenwald Date: Wed, 29 May 2024 08:42:00 +0200 Subject: [PATCH] Improve PackageName parsing from manifest read 'Automatic-Module-Name' (used in apache http) only use 'Bundle-Name' if no other is found --- cmd/mendix-userlib-cleaner/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/mendix-userlib-cleaner/main.go b/cmd/mendix-userlib-cleaner/main.go index 07ed507..f56121c 100644 --- a/cmd/mendix-userlib-cleaner/main.go +++ b/cmd/mendix-userlib-cleaner/main.go @@ -201,7 +201,8 @@ func parseManifest(filePath string, text string) JarProperties { key := pair[0] value := pair[1] - if key == "Bundle-SymbolicName" || key == "Extension-Name" { + // Automatic-Module-Name - used in org.apache.httpcomponents.httpclient / org.apache.httpcomponents.client5.httpclient5 + if key == "Bundle-SymbolicName" || key == "Extension-Name" || key == "Automatic-Module-Name" { jarProp.packageName = value } else if key == "Bundle-Version" || key == "Implementation-Version" { jarProp.version = value @@ -216,7 +217,10 @@ func parseManifest(filePath string, text string) JarProperties { continue } jarProp.name = value - jarProp.packageName = value + if jarProp.packageName == "" { + // only use Bundle-Name as packageName if no alternative exists + jarProp.packageName = value + } } } return jarProp