Announcement Announcement Module
Collapse
No announcement yet.
How to dynamically update the constant values in tiles.xml during maven packaging? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to dynamically update the constant values in tiles.xml during maven packaging?

    Hello,

    I am new to Spring MVC, Tiles, and Maven framework and I'm hoping someone will guide me to the right direction to the better practice on updating platform dependent properties. I have a tiles.xml which defines a path to the JSP with a list of JavaScript/CSS imports.

    HTML Code:
        <definition name="abc" extends="base.definition">
            <put-attribute name="imports" value="/WEB-INF/jsp/imports.jsp" />
        </definition>
    During the deployment, I'd like to switch to import minified version of JavaScript/CSS files which are listed in a different JSP file.

    HTML Code:
        <put-attribute name="imports" value="/WEB-INF/jsp/importsMInified.jsp" />
    I'm assuming switching or rewriting the content of either this tiles.xml or some sort of properties files which defines environment specific definitions during one of the mvn deployment life cycle. However, I could not find a good example on accomplishing this task. If anyone has experienced this circumstance, could you please advise me what would be a better solution to switching imports? I'm also not sure dividing into two JSP files are better solution or not.

    Thank you,
    syamashi

  • #2
    I realized a similar post where web.xml could be switched with maven-war-plugin and profiles where <webXml> is used.

    http://stackoverflow.com/questions/3...eb-app-project

    So if I want to do the same to tiles.xml, is there a specific tag supported in maven-war-plugin? If not, how do I apply include/exclude to decide which tiles.xml to import on a given profile id?

    Comment

    Working...
    X