利用maven将多个工程组织起来,使得不同的项目可以互相引用。在处理SpringBootServletInitializer的时候,一直出错,错误信息如下:
error: package org.springframework.boot.context.web does not exist找了好久,一直以为是maven的错误,后来才发现是在springboot1.5中,org.springframework.boot.context.web.SpringBootServletInitializer is deprecated。 单独利用maven编译这个工程,而不是以module的形式,也不会出现这个错误。在module中,正确的引用方式是:
import org.springframework.boot.web.support.SpringBootServletInitializer;这样就正确了。。。fuck!
本文解决了在使用Spring Boot 1.5版本时遇到的Servlet初始化问题,详细介绍了如何替换过时的导入包以避免错误,并提供了正确的导入方式。
5829

被折叠的 条评论
为什么被折叠?



