In my java webapp project I have all the jsp files placed at src/main/webapp/jsp.
How do I enable the filtering and replace property placeholders with actual values while building the war?
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<filters><filter>${basedir}/src/main/resources/filter.properties</filter></filters>
<webResources>
<resource>
<directory>src/main/webapp/jsp</directory>
<targetPath>/jsp/</targetPath>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
Attaching the console output of mvn package command :
[exec] [INFO] Copying webapp webResources [projectbasedir/src/main/webapp/jsp] to [projectbasedir/target/myapp]
[exec] [INFO] Copying webapp resources [projectbasedir/src/main/webapp]
The jsp files are getting filtered properly in "Copying webapp webResources"
step but "Copying webapp resources"
step overwrites all these changes since it copies everything from src/main/webapp folder
to target folder afresh.
How do I make this filtering work?