boot idea无法识别spring_基于gradle和springboot的IDEA项目@SpringBootApplication无法识别,怎么办?...

基于gradle和springboot的IDEA项目下面的内容如@SpringBootApplication无法识别

import org.springframework.boot.SpringApplication;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import org.springframework.boot.builder.SpringApplicationBuilder;

import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

//

@SpringBootApplication

如下图无法识别:

build.gradle文件的内容:

plugins {

id 'org.springframework.boot' version '2.2.5.RELEASE'

id 'io.spring.dependency-management' version '1.0.9.RELEASE'

id 'java'

}

group = 'com.iherb'

version = '0.0.1-SNAPSHOT'

sourceCompatibility = '11'

repositories {

mavenLocal()

mavenCentral()

}

dependencies {

implementation 'org.springframework.boot:spring-boot-starter-web'

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

implementation 'org.springframework.boot:spring-boot-starter-parent'

implementation 'org.springframework.boot:spring-boot-dependencies'

implementation 'org.springframework.boot:spring-boot-maven-plugin'

testImplementation('org.springframework.boot:spring-boot-starter-test') {

exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'

}

}

test {

useJUnitPlatform()

}

IDEA右侧看不到gradle选项:

重新打开项目后来好了


版权声明:本文为weixin_39675215原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。