I have CSS and JavaScript files in src/main/webapp
directory of my project.
I want to join add joined and minified version of these resources to my WAR file and to
Use warSourceDirectory
:
${project.build.directory}/${project.build.finalName}
Instead of this configuration property (warDirectory
) for the tomcat-maven-plugin
:
${project.build.directory}/${project.build.finalName}
According to the tomcat-maven-plugin documentation, warSourceDirectory
is where the web resources get picked up, and its default value is ${basedir}/src/main/webapp
. This means that if you don’t set that property, you need to generate your unified/minified JavaScript file under ${basedir}/src/main/webapp
.
If you set warSourceDirectory
to the output folder, this means you need to generate this file before starting Tomcat.