Pivotal Knowledge Base


How to Customize Java Build packs Tomcat's Server.xml


 Product  Version
 Pivotal Cloud Foundry  1.7, 1.8
 Tomcat  7.x, 8.x


This article provides 2 ways by which you can provide your customized server.xml to Tomcat that will run in Pivotal Cloud Foundry.


Option 1: Forking the Java build pack

1. Create a custom build pack based on Java build pack.

2. Edit Java build pack's server.xml, specifically this file:


3. cf push your application using your custom build pack. 

Option 2: Using an external server.xml 

1. Create an artifact in a repository in TAR format and must follow the Tomcat archive structure:


2. Edit your application's manifest.yml and specify the following environment variable:

JBP_CONFIG_TOMCAT: "{ tomcat: { external_configuration_enabled: true }, external_configuration: { repository_root: \"http://repository...\" } }"

3. cf push your application.

Additional Information

Java Buildpack's Tomcat Container 



  • Avatar
    Todd Robbins

    If you are using external server method + offline buildpack then you will need to enable remote_downloads otherwise it will fail due to locking issue:

    JBP_CONFIG_CACHE: '{ remote_downloads: enabled }'

Powered by Zendesk