Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How replace contex-param values in web.xml with maven?

I want to create one maven profile that will search web.xml in all project that will used it and replace necessary values in web.xml. I do not want to insert maven properties in web.xml, but just create one profile for all projects that contains web.xml. For example I want replace javax.faces.PROJECT_STAGE value:

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Production</param-value>
</context-param>

to

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

I want to create one profile that will search web.xml and do necessary replaces, but without modification original web.xml to:

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>${maven.property}</param-value>
</context-param>    

Is that possible with maven?

like image 950
Cherry Avatar asked Jul 03 '13 08:07

Cherry


1 Answers

It would be better use maven itself https://community.jboss.org/wiki/HowToConfigureJavaEEApplicationToApplyDifferentSettingsinWebxmlEtcForVariousEnvironmentsByMaven

like image 186
Marx Avatar answered Oct 14 '22 05:10

Marx