We have a database library that gets the connection information (user, host, etc) from a properties file. This file can be a `config.properties` file located in the classpath, or next to the execution jar or can be passed as an argument `-Dproperties=/path/to/myConfig.properties`.

We also have several applications that use this library, so each one has its own config.properties file used in its own execution.

But now I'm creating two web applications that use the same library. So, if I deploy them in Tomcat (war file), I have two options (to my knowledge):

1.- Include each config inside the WAR file. But with this, every time I need to tweak something in the `config.properties` I'll have to repack the war.

2.- Pass the `-Dproperties` parameter as an execution argument of Tomcat. But different war deployments will have to share the same properties file.

Is there a way around this?

Can I pass the `-D` argument to a specific deployment in Tomcat (or any other server)?

PS: This is one of the scenarios we have, but is not constraint to database connection info. We have other libraries that get parameters through `config.properties` file.

**EDIT**: I *want* to be able to have different `config.properties` file for each deployment. Not the same properties shared among them.

I think I found a way around using self contained webserver inside the application, like Jetty.