要使用配置文件来构建工件,您需要像以下图像中所示创建一个Maven Run/Debug配置。 然后,在Tomcat Run/Debug Configuration中的“Before Launch”部分中添加上述构建,方法是单击“+”按钮并选择“Run Another Configuration”,然后选择maven build。 结果应如下图所示。 现在,如果您首先运行Tomcat配置,则会在Tomcat之前执行Maven构建。