The application I have inherited is configured by a properties file passed in with a -D option from a shell script:
*-Dcom.gtnet.systemProperties.override.url=file:/usr1/app/gtx/config/override.properties_$INST*
We run multiple concurrent instances of this application, and currently each has an individual properties file. The only difference in each of the files is the name of the log file. So we end up with multiple, almost identical files spread across many servers.
My question, is there any way to parameterize, or extend the properties file in such a way that we could just pass in the name of the instance and use that inside the file? Thus we’d only have one file per server. We don’t have the option of modifying the application code and we need to pass the file in at application start up.
The built in
java.util.Properties#load(...)supports neither#includesnor variable substitution.If you happen to know the the application is not using
Properties.load, but is instead its own logic, you can look into whether is does this… but barring existing support, you would have to modify the application code.Since you mention that modifying the application code is not an option… you should consider using a properties file generator, and manage the template for generating the properties file. So you’d still have a bunch of fully expanded properties files, but they would be mastered using one template file, possibly a parameter values files, and the properties file generator.