1

I have a web application which runs on Jetty. I pack my applications as .war and then deploy it on the server.

I would like to serve the same application to multiple tenants without copying the whole project with different name each time. The only difference between tenants is the parameter file which contains the database connection details.

Currently for each tenant I copy-paste my project in Eclipse with a new name and then change the parameter file. If I change anything in the code I have to update it on all projects.

The ideal would be to have a command to run the same code on different names each using different property file: app.war -> dummy.com/app1 dummy.com/app2 dummy.com/app3

How that can be achieved?

Emin
  • 270
  • 1
  • 2
  • 13
  • Is each tenant on a different Jetty server? (with its own host and/or port?) – Joakim Erdfelt Apr 30 '15 at 12:40
  • yes, each tenant has the same port and host: www.dummy.com/client1, www.dummy.com/client2. Later it can be client.dummy.com, client2.dummy.com – Emin Apr 30 '15 at 15:04

1 Answers1

0

Use environment variables to choose configuration. For example set Environment=dev or Environment=test or Environment=WEB1 and then use this value to choose what configuration to use.

Alex
  • 4,457
  • 2
  • 20
  • 59
  • thanks, but I still need to deploy the same war with different names. – Emin Apr 30 '15 at 12:10
  • Why? You want to run the same app on the same server but with different web root? Then just simply copy your war file with different name to the deploy directory. And, in this case, you don't even need Environment Variable - you can use this different web root to chose configuration, – Alex Apr 30 '15 at 12:17
  • @Alex he doesn't need to copy the war file, context deployment could do most (if not all) of it. He could even write his own AppProvider for the DeploymentManager to manage it all dynamically. – Joakim Erdfelt Apr 30 '15 at 14:21