Skip to content

Enables Tomcat to read properties from an external file and substitute them using the ${property} syntax in Tomcat configuration files.

License

Notifications You must be signed in to change notification settings

ncredinburgh/tomcat-external-propertysource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central

Tomcat External PropertySource

This library provides a Tomcat Property Source that reads property values from an external file.

Getting Started

Download the Library

  • Download the latest version of the library using the link in the Maven Central badge at the top of this page.

Install the library

  • Copy the JAR file to the folder ${TOMCAT_HOME}/lib

Configure Tomcat

  • Configure Tomcat to use the property source provided by the library and specify the filename of the property file using the following Java system properties.
-Dorg.apache.tomcat.util.digester.PROPERTY_SOURCE=com.github.ncredinburgh.tomcat.ExternalPropertySource"
-Dcom.github.ncredinburgh.tomcat.ExternalPropertySource.FILENAME=tomcat.properties

Replace the value tomcat.properties with the path of your file.

If a relative path is specified it will be resolved against the current working directory (system property user.dir).

For more information on Tomcat property replacement and other system properties see the Tomcat Configuration Reference.

Encryption

The property source allows the properties file to be stored in an encrypted form on disk for the purposes of security. During Tomcat startup the properties file is decrypted and used by Tomcat to perform property replacement. See Encryption Support for more details.

Troubleshooting

Any error encountered during the loading of the property source will be logged to the Tomcat log file $TOMCAT_HOME/logs/catalina.out. Errors encountered during the loading of the property source do not prevent Tomcat starting. However, property values expected from the file will not be available.

Debug Logging

The property source can write debug information to the Tomcat log file $TOMCAT_HOME/logs/catalina.out by adding the following line to the Tomcat logging configuration file $TOMCAT_HOME/conf/tomcat.properties:

com.github.ncredinburgh.tomcat.level = FINE

Contributing

All contributions are welcome. Just fork this repository and send us a merge request. Just make sure your code meets the following requirements:

Releases

  • 1.2 Added options to specify whether to keep or remove input file (to ease automation)
  • 1.1 Added support for encrypted properties file
  • 1.0 Initial release

About

Enables Tomcat to read properties from an external file and substitute them using the ${property} syntax in Tomcat configuration files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages