Unable to infer base url. This is common when using dynamic servlet registration or when the API is

版权声明:原创博文,转载请注明出处~ https://blog.csdn.net/She_lock/article/details/84134545

问题:
在这里插入图片描述

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway. The base url is the root of where all the swagger resources are served. For e.g. if the api is available at http://example.org/api/v2/api-docs then the base url is http://example.org/api/. Please enter the location manually:

解决办法:
让你的Application 启动类继承SpringBootServletInitializer,然后scanBasePackages包范围内都扫描,因为你可能还依赖了子项目,子项目中的配置信息也要扫描进来。

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class, scanBasePackages = "com.sx.*")
public class WangDianApplication extends SpringBootServletInitializer {

    public static void main(String args[]) {
        SpringApplication.run(WangDianApplication.class, args);
    }
}

猜你喜欢

转载自blog.csdn.net/She_lock/article/details/84134545