根据某些 System.getProperty() 更改 web.xml

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

是否可以在基于环境的基础上使用或替代使用过的 web.xml?

我正在使用 maven,我在想是否可以切换?

考虑

maven profiles

然后使用命令行发送您的系统参数

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

或使用maven-antrun-plugin so you can process the env variable in ant of without e contrib-if