1

I'm working on small spring boot project using gradle and intellij idea. After I created a project and restarted intellij idea build.gradle file contents became gray. But despite this it runs well and I don't get any compilation errors. Intellij Idea Ultimate version 2019.3.1, java 8, gradle 6.0.1, spring boot 2.1.7 The code of build.gradle is below.

plugins {
    id 'org.springframework.boot' version '2.1.7.RELEASE'
    id 'java'
}

apply plugin: 'io.spring.dependency-management'

group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

configurations {
    developmentOnly
    runtimeClasspath {
        extendsFrom developmentOnly
    }
}

repositories {
    maven { url 'https://maven.aliyun.com/repository/public/' }
    mavenCentral()
}

dependencies {
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

I've tried to restart Idea again. It didn't help. Then I've tried to use an older version of gradle but everything remains as before.

  • Hi @KarinaKHUSN, can you share your code or a minimal working sample on GitHub please. – hce Jan 13 '20 at 22:45
  • Could you please share a screenshot of how this file looks like in the IDE? Make sure it's mapped to the correct file type (https://stackoverflow.com/a/13374653/104891). Please also try File | Invalidate Caches | Invalidate and Restart. – CrazyCoder Jan 13 '20 at 22:49
  • File | Invalidate Caches | Invalidate and Restart -> works for me @CrazyCoder, Thanks a lot – WUJ Aug 06 '20 at 06:30

0 Answers0