RestController注释是org的一部分.springframework:SpringWeb:依赖关系
org.springframework:spring-web依赖关系是org.springframework.boot:spring-boot-starter-webflux jar的一部分,所以应该得到解决.通过从终端运行mvn dependency:tree命令,可以判断完整的依赖关系层次 struct .
[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:2.6.6:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.6.6:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.6.6:compile
[INFO] | | | \- org.springframework:spring-context:jar:5.3.18:compile
[INFO] | | | +- org.springframework:spring-aop:jar:5.3.18:compile
[INFO] | | | \- org.springframework:spring-expression:jar:5.3.18:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.6.6:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.6.6:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.11:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.11:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.17.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.36:compile
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.29:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.6.6:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2.2:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.2:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.2:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.6.6:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-http:jar:1.0.17:compile
[INFO] | | +- io.netty:netty-codec-http:jar:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-common:jar:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-buffer:jar:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.75.Final:compile
[INFO] | | | \- io.netty:netty-handler:jar:4.1.75.Final:compile
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.75.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns:jar:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-resolver:jar:4.1.75.Final:compile
[INFO] | | | \- io.netty:netty-codec-dns:jar:4.1.75.Final:compile
[INFO] | | +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.75.Final:compile
[INFO] | | | \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.75.Final:compile
[INFO] | | +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.75.Final:compile
[INFO] | | | +- io.netty:netty-transport-native-unix-common:jar:4.1.75.Final:compile
[INFO] | | | \- io.netty:netty-transport-classes-epoll:jar:4.1.75.Final:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty-core:jar:1.0.17:compile
[INFO] | | \- io.netty:netty-handler-proxy:jar:4.1.75.Final:compile
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.75.Final:compile
[INFO] | +- org.springframework:spring-web:jar:5.3.18:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.3.18:compile
[INFO] | \- org.springframework:spring-webflux:jar:5.3.18:compile
If you are starting a new project you can use the spring initializer -
100