From c12a417576cce8e76f7f540b8337a1085b3875e9 Mon Sep 17 00:00:00 2001 From: pg2000 <10741029+PG2000@users.noreply.github.com> Date: Wed, 23 Oct 2024 22:14:01 +0200 Subject: [PATCH] feat: add support for multiple war files Closes: https://github.com/paketo-buildpacks/apache-tomcat/issues/134 --- tomcat/detect.go | 2 +- tomcat/detect_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tomcat/detect.go b/tomcat/detect.go index 8370930..500dc59 100644 --- a/tomcat/detect.go +++ b/tomcat/detect.go @@ -88,7 +88,7 @@ func (d Detect) Detect(context libcnb.DetectContext) (libcnb.DetectResult, error file := filepath.Join(context.Application.Path, "WEB-INF") if _, err := os.Stat(file); err != nil && !os.IsNotExist(err) { return libcnb.DetectResult{}, fmt.Errorf("unable to stat file %s\n%w", file, err) - } else if os.IsNotExist(err) { + } else if os.IsNotExist(err) && !warFilesExist { d.Logger.Info("PASSED: a WEB-INF directory was not found, this is normal when building from source") return result, nil } diff --git a/tomcat/detect_test.go b/tomcat/detect_test.go index 2bee7e0..0be7b68 100644 --- a/tomcat/detect_test.go +++ b/tomcat/detect_test.go @@ -187,6 +187,7 @@ func testDetect(t *testing.T, context spec.G, it spec.S) { Provides: []libcnb.BuildPlanProvide{ {Name: "jvm-application"}, {Name: "java-app-server"}, + {Name: "jvm-application-package"}, }, Requires: []libcnb.BuildPlanRequire{ {Name: "syft"},