我正在使用tomcat7-maven-plugin
,我的 Web 应用程序存储在src/main/webapp
. 它是一个 React 应用程序,所以我运行npm run build
以在src/main/webapp/build
. 我的问题是,每当我打包 webapp 时,都会打包整个webapp
文件夹(包括node_modules
...),而不仅仅是build
文件夹。
这是我的插件配置:
<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>
我怎样才能让插件只打包webapp/build
目录?或者也许有办法至少node_modules
从包中排除,因为所有这些模块仅用于创建我的 webapp 的打包版本?