Импорт org.springframework.web не может быть разрешен.Затмение - PullRequest
0 голосов
/ 14 февраля 2019

Не удается разрешить импорт org.springframework.web.

Eclipse не может импортировать библиотеки Spring.

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.ui.Model;
import task1.exception.NotFoundException;

Мой файл build.gradle:

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



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

group = 'task1'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'

repositories {
mavenCentral()
}

dependencies {

implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
 compile("org.springframework.boot:spring-boot-starter-web")
}

enter image description here

Но когда я собираю этот проект в терминале, он уже собирается и запускается.

1 Ответ

0 голосов
/ 14 февраля 2019

Попробуйте щелкнуть правой кнопкой мыши файл build.gradle и выполните:

file -> Gradle -> Refresh Dependencies
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...