AlexSC
AlexSC

Reputation: 1943

How to use different web.xml file for different running environments with maven

I have a JSF2 project that is deployed in a JBoss 7 server. When running the application in my own computer (during development and testing), I use a version of web.xml file with certain content, but when I have to deploy the same application in the production server, I have to use different settings in the same web.xml file.

Nowadays I have to comment some parts and uncomment others in each situation, what seems to be a very poor "solution" for my situation.

How could I have different web.xml files or contents that will be used in different deploy conditions?

TIA

Upvotes: 1

Views: 670

Answers (1)

Manish Prajapati
Manish Prajapati

Reputation: 392

You can use jenkins to deploy your application. That has plugins named Config File Provider that allow you to configure files based on your requirement. So in that way you can use second version of web.xml and jenkin will deploy application with your new web.xml

Upvotes: 1

Related Questions