I'm a beginner at Spring boot trying to get a simple web application up and running. The problem I'm experiencing is that the IntellIJ IDE is not recognizing the spring framework imports, so some parts of my code are outlined in red(as in a Syntax Error). I can still run my application using gradlew, building the project through my terminal.
buildscript {
repositories{
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.1.6.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
bootJar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
testCompile("junit:junit")
}
This is the build.gradle file I'm using.
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
These are the imports I am using which are not recognized by my IDE. I was wondering if I should download the spring library? Although I've seen that with Maven an XML file is enough make use of the spring libraries.