javamavenmaven-3war

Why and how to avoid Maven to replace ${id} in jsp on mvn package


When I "mvn package" my webapp, all occurences of ${id} in jsp are replace by

com.domainname.projectname:project-warname:war:0.0.1-SNAPSHOT

Maven Version 3.0.5

pom.xml:

<plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.3</version>
    <configuration>
        <webResources>
            <resource>
                <directory>src/main/webapp</directory>
                <filtering>true</filtering>
            </resource>
        </webResources>
    </configuration>
</plugin>

Initial Jsp:

<c:url var="myUrl" value="/view/${id}"/>

Jsp in war after "mvn package":

<c:url var="myUrl" value="/view/com.domainname.projectname:project-warname:war:0.0.1-SNAPSHOT"/>

How can I avoid that ?


Solution

  • <filtering>true</filtering>
    <includes>
      <include>**/directoryNameWithKeysToReplace/*</include>
    </includes>