support .kar files (#3113)

* add kar

Signed-off-by: tomersein <tomersein@gmail.com>
This commit is contained in:
GGMU 2024-08-12 19:10:03 +03:00 committed by GitHub
parent c19cf626ab
commit 91cf066db6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 1 deletions

View file

@ -108,7 +108,7 @@ func (a archiveFilename) extension() string {
func (a archiveFilename) pkgType() pkg.Type {
switch strings.ToLower(a.extension()) {
case "jar", "war", "ear", "lpkg", "par", "sar", "nar":
case "jar", "war", "ear", "lpkg", "par", "sar", "nar", "kar":
return pkg.JavaPkg
case "jpi", "hpi":
return pkg.JenkinsPluginPkg

View file

@ -86,6 +86,13 @@ func TestExtractInfoFromJavaArchiveFilename(t *testing.T) {
name: "pkg-extra-field-maven",
ty: pkg.JavaPkg,
},
{
filename: "pkg-extra-field-maven-4.3.2-rc1.kar",
version: "4.3.2-rc1",
extension: "kar",
name: "pkg-extra-field-maven",
ty: pkg.JavaPkg,
},
{
filename: "/some/path/pkg-extra-field-maven-4.3.2-rc1.jpi",
version: "4.3.2-rc1",

View file

@ -31,6 +31,7 @@ var archiveFormatGlobs = []string{
"**/*.nar",
"**/*.jpi",
"**/*.hpi",
"**/*.kar",
"**/*.lpkg", // Zip-compressed package used to deploy applications
// (aka plugins) to Liferay Portal server. Those files contains .JAR(s) and a .PROPERTIES file, the latter
// has information about the application and installation requirements.

View file

@ -23,6 +23,7 @@ func Test_ArchiveCataloger_Globs(t *testing.T) {
"java-archives/example.par",
"java-archives/example.sar",
"java-archives/example.nar",
"java-archives/example.kar",
"java-archives/example.jpi",
"java-archives/example.hpi",
"java-archives/example.lpkg",

View file

@ -0,0 +1 @@
example archive