Java 当为spring boot多模块项目部署war文件时,Tomcat给出404错误。在IDE中使用相同的tomcat启动时,它工作正常

Java 当为spring boot多模块项目部署war文件时,Tomcat给出404错误。在IDE中使用相同的tomcat启动时,它工作正常,java,spring,spring-boot,spring-mvc,tomcat,Java,Spring,Spring Boot,Spring Mvc,Tomcat,当为spring boot多模块项目部署war文件时,Tomcat给出404错误。 在IDE中使用相同的tomcat启动时,它工作正常 父pom中的代码 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>

当为spring boot多模块项目部署war文件时,Tomcat给出404错误。 在IDE中使用相同的tomcat启动时,它工作正常

父pom中的代码

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.2.RELEASE</version>
        <relativePath />
    </parent>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

您使用哪个URL访问此文件?我正在使用本地端
@SpringBootApplication
@RestController
public class ABC extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ABC.class);
    }

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

    @RequestMapping(value = "/")
    public String hello() {
        return "Hello World from Tomcat";
    }
}