cloudfoundry / java-buildpack

Cloud Foundry buildpack for running Java applications
Apache License 2.0
433 stars 2.59k forks source link

Adds support for Tomcat 10.1 alongside 9 #1076

Closed pivotal-david-osullivan closed 1 month ago

pivotal-david-osullivan commented 2 months ago

Adds support for multiple version lines of Tomcat (similar to JRE lines), as 9 & 10.1 are current stable lines.

anthonydahanne commented 1 month ago

Tested this change with this simple webapp: https://github.com/Azure-Samples/tomcat10-jakartaee9

When running it with no specific configuration, it deployed it on Tomcat Instance 9.0.87 and while no errors were displayed, it could not display (404 error) the HelloServlet which relies on jakarta while Tomcat 9 does not support jakarta

Then, I repushed with:

---
applications:
- name: tomcat10
  memory: 2G
  random-route: true
  path: target/helloworld.war
  buildpacks:
    - https://github.com/cloudfoundry/java-buildpack.git#tomcat_version_lines

  env:
    JBP_LOG_LEVEL: info
    JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}'
    JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 17.+ } }'
    JBP_CONFIG_TOMCAT: '{ tomcat: { version: 10.1.+ }}'

and the servlet could be displayed properly, as I could see Tomcat Instance 10.1.24 was being downloaded and used.

anthonydahanne commented 1 month ago

LGTM