吴裕雄天生自然SPRINGBOOT开发实战处理annotation.GetMapping cannot be resolved

可能是parent版本没有选对。

修改前:

<parent>
        <!-- 依赖管理,引入以后在声明其它dependency的时候就不需要version -->
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.3.0.RELEASE</version>
        <relativePath />
    </parent>

修改后:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
原文地址:https://www.cnblogs.com/tszr/p/15232549.html