I am building one war file using mvn clean install -Dlifecycle=dev . so i have variable lifecycle.
Now my requirement is , when i create build file for UAT/PROD it must exclude one jsp(index.jsp) from package .My jsp is in webApps directory parallel to resources.
Using profile only for one page filtering is not good idea i think.
Appreciate any help .
It starts with one JSP. Next is a customized CSS. Then different DB properties…
A profile is the way to go. Just create one, set its activation to the value of the variable, create another source folder with the JSP and add it to the resources in the profile.
So:
src/dev/webappin your project folder (so it is parallel tosrc/main/webapp)pom.xmlthat configures the war pluginThis copies the resources from
src/dev/webappsinto the merged target folder when the variablelifecycleis set todev.Even if those are quite some lines of XML for copying a single file I think it is not a good idea to do it different (e.g. with a plugin that deletes files) when using Maven. While you can customize Maven builds so they aren’t recognizable any more, the whole idea is to use the conventions so others can easily read the process.