I am using tomcat7-maven-plugin, and my web application is stored in src/main/webapp. It is a React app, so I run npm run build to generate a "compiled" version in src/main/webapp/build. My problem is that whenever I package the webapp, the whole webapp folder is packaged (including node_modules...), instead of just the build folder.
Here is my configuration for the plugin:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>9090</port>
<!-- I am looking for something of the following form -->
<webappPath>build</webappPath>
</configuration>
</plugin>
</plugins>
</pluginManagement>
How could I make the plugin only package the webapp/build directory? Or maybe is there a way to at least exclude node_modules from the package, since all these modules are only used to create that packaged version of my webapp?