Maven项目,当run install时, problem 弹出“The project was not built since its build path is incomplete. Cannot find the class file for javax.servlet.ServletContext ”
解决:
打开pom.xml,找到
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
将其中的
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
删除
重新maven - run - install即可。