2017-04-23 172 views
1
解決

我在SpringBoot項目基於ServletRegistrationBean不能SpringBoot

<parent> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-parent</artifactId> 
     <version>1.3.2.RELEASE</version> 
     <relativePath/> <!-- lookup parent from repository --> 
    </parent> 

我更新了POM以

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.5.3.RELEASE</version> 
    <relativePath/> <!-- lookup parent from repository --> 
</parent> 

有最新版本的工作,但在那之後我不能編譯該項目了,因爲我有這個問題:

The import org.springframework.boot.context.embedded.ServletRegistrationBean cannot be 
resolved 

回答

5

解決!

org.springframework.boot.context.embedded.ServletRegistrationBean已棄用1.4贊成或org.springframework.boot.web.servlet.ServletRegistrationBean。前者在1.5版中被刪除,因爲它已被棄用