@@ -156,28 +156,35 @@ func getJarProps(filePath string) JarProperties {
156
156
return jar2
157
157
}
158
158
}
159
- log .Warningf ("Failed to parse %v" , filePath )
159
+ log .Warningf ("Failed to parse metadata from %v" , filePath )
160
160
161
161
return JarProperties {filePath : "" }
162
162
}
163
163
164
164
func parseManifest (filePath string , text string ) JarProperties {
165
165
lines := strings .Split (text , "\n " )
166
- jarProp := JarProperties {filePath : filePath , packageName : "" , fileName : filepath .Base (filePath )}
166
+ jarProp := JarProperties {filePath : filePath , packageName : "" , fileName : filepath .Base (filePath ), version : "" }
167
167
for _ , line := range lines {
168
168
line = strings .TrimSpace (line )
169
169
pair := strings .Split (line , ": " )
170
- if pair [0 ] == "Bundle-SymbolicName" {
171
- jarProp .packageName = pair [1 ]
172
- } else if pair [0 ] == "Bundle-Version" {
173
- jarProp .version = pair [1 ]
170
+
171
+ if len (pair ) < 2 {
172
+ continue
173
+ }
174
+
175
+ key := pair [0 ]
176
+ value := pair [1 ]
177
+ if key == "Bundle-SymbolicName" || key == "Extension-Name" {
178
+ jarProp .packageName = value
179
+ } else if key == "Bundle-Version" || key == "Implementation-Version" {
180
+ jarProp .version = value
174
181
jarProp .versionNumber = convertVersionToNumber (jarProp .version )
175
- } else if pair [ 0 ] == "Bundle-Vendor" {
176
- jarProp .vendor = pair [ 1 ]
177
- } else if pair [ 0 ] == "Bundle-License" {
178
- jarProp .license = pair [ 1 ]
179
- } else if pair [ 0 ] == "Bundle-Name" {
180
- jarProp .name = pair [ 1 ]
182
+ } else if key == "Bundle-Vendor" || key == "Implementation -Vendor" {
183
+ jarProp .vendor = value
184
+ } else if key == "Bundle-License" {
185
+ jarProp .license = value
186
+ } else if key == "Bundle-Name" || key == "Implementation-Title " {
187
+ jarProp .name = value
181
188
}
182
189
}
183
190
return jarProp
0 commit comments