在pom.xml添加这个插件
<build>标签:web,maven,报错,3.1,test,org,mojo,codehaus From: https://www.cnblogs.com/xiaofeilin/p/16850646.html
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<classpathScope>test</classpathScope>
</configuration>
</plugin>
</plugins>
</build>