From 64ee8c096e53cb6841ea091231a3e488d8129fd0 Mon Sep 17 00:00:00 2001 From: Kiril Keranov Date: Fri, 16 Jan 2026 22:38:43 +0200 Subject: [PATCH 1/2] Fix SAP Machine JRE version different than default --- src/java/jres/jre.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/java/jres/jre.go b/src/java/jres/jre.go index 257f069507..670eb91877 100644 --- a/src/java/jres/jre.go +++ b/src/java/jres/jre.go @@ -225,6 +225,13 @@ func GetJREVersion(ctx *common.Context, jreName string) (libbuildpack.Dependency } } + if envVal == "" && jreName == "sapmachine" { + envVal = os.Getenv("JBP_CONFIG_SAP_MACHINE_JRE") + if envVal != "" { + envKey = "JBP_CONFIG_SAP_MACHINE_JRE" + } + } + if envVal != "" { ctx.Log.Debug("Found %s='%s'", envKey, envVal) From 92cc106ac2be5097b74a34aa7a6f61a66589ccc9 Mon Sep 17 00:00:00 2001 From: Kiril Keranov Date: Fri, 16 Jan 2026 22:54:19 +0200 Subject: [PATCH 2/2] Add int tests --- src/integration/tomcat_test.go | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/integration/tomcat_test.go b/src/integration/tomcat_test.go index a35f54b3ed..8dbccd990c 100644 --- a/src/integration/tomcat_test.go +++ b/src/integration/tomcat_test.go @@ -262,6 +262,50 @@ func testTomcat(platform switchblade.Platform, fixtures string) func(*testing.T, }) }) + context("with JBP_CONFIG_SAP_MACHINE_JRE version selection", func() { + it("respects JBP_CONFIG_SAP_MACHINE_JRE(version 17) over manifest default", func() { + deployment, logs, err := platform.Deploy. + WithEnv(map[string]string{ + "JBP_CONFIG_COMPONENTS": "{ jres: [\"JavaBuildpack::Jre::SapMachineJRE\"] }", + "JBP_CONFIG_SAP_MACHINE_JRE": "{ jre: {version: 17.+} }", + }). + Execute(name, filepath.Join(fixtures, "containers", "tomcat_jakarta")) + + Expect(err).NotTo(HaveOccurred(), logs.String) + + Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 17.")) + Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK"))) + }) + + it("respects JBP_CONFIG_SAP_MACHINE_JRE(version 21)", func() { + deployment, logs, err := platform.Deploy. + WithEnv(map[string]string{ + "JBP_CONFIG_COMPONENTS": "{ jres: [\"JavaBuildpack::Jre::SapMachineJRE\"] }", + "JBP_CONFIG_SAP_MACHINE_JRE": "{ jre: {version: 21.+} }", + }). + Execute(name, filepath.Join(fixtures, "containers", "tomcat_jakarta")) + + Expect(err).NotTo(HaveOccurred(), logs.String) + + Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 21.")) + Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK"))) + }) + + it("respects JBP_CONFIG_SAP_MACHINE_JRE(version 25) over manifest default", func() { + deployment, logs, err := platform.Deploy. + WithEnv(map[string]string{ + "JBP_CONFIG_COMPONENTS": "{ jres: [\"JavaBuildpack::Jre::SapMachineJRE\"] }", + "JBP_CONFIG_SAP_MACHINE_JRE": "{ jre: {version: 25.+} }", + }). + Execute(name, filepath.Join(fixtures, "containers", "tomcat_jakarta")) + + Expect(err).NotTo(HaveOccurred(), logs.String) + + Expect(logs.String()).To(ContainSubstring("Installing SAP Machine 25.")) + Eventually(deployment).Should(matchers.Serve(ContainSubstring("OK"))) + }) + }) + context("with external Tomcat configuration", func() { it("downloads and applies configuration from real repository", func() { // This test verifies the external configuration workflow: