Search code examples
javamavenjakarta-eejava-ee-6java-ee-7

Changing web.xml depending on certain System.getProperty()


Is it possible to use or alternate the used web.xml on an environment based basis?

I am using maven, and i am thinking that it might be possible to switch?


Solution

  • Consider

    maven profiles

    Then send your system parameter using command line

    mvn groupId:artifactId:goal -P %your env_var%
    

    Or use maven-antrun-plugin so you can process the env variable in ant of without e contrib-if