Maven: Customize web.xml of web-app project

前端 未结 7 2046
梦如初夏
梦如初夏 2020-11-30 20:27

I have a web application Maven project, and I want to customize the web.xml file depending on the Profile that is running. I am using the Maven-War-plugin, which allows me

相关标签:
7条回答
  • 2020-11-30 21:30

    Comment to Chris Clark answer. You can reverse - so in development you do not want to have any constraints (security or jndi, other)

    <!-- ${enable.security.end}
    <security-constraint>
        ...
    </security-constraint>
    
    
    ${enable.security.start} -->
    

    So in development you have commented out section. But in production it will be translated to (with maven profile):

    <!-- -->
    <security-constraint>
        ...
    </security-constraint>
    
    
    <!-- -->
    

    and commented section will be visible.

    0 讨论(0)
提交回复
热议问题