0

I have a Spring application using Gradle.

This is my grade.build

plugins {
    id 'org.springframework.boot' version '2.4.2'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

group = 'test.bis'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.flywaydb:flyway-core'
    implementation group: 'io.springfox', name: 'springfox-swagger2', version: '3.0.0'
    implementation group: 'io.springfox', name: 'springfox-swagger-ui', version: '3.0.0'

    compileOnly 'org.projectlombok:lombok'
    runtimeOnly 'com.oracle.database.jdbc:ojdbc8'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

test {
    useJUnitPlatform()
}

When I want to build the jar, I get this error:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    SpringApplication cannot be resolved

    at test.bis.TestApplication.main(TestApplication.java:10)

When I look in my Eclipse, I get errors like this:

enter image description here

Why, when I build in Eclipse, do I get this error? The code was built by my friend using IntelliJ.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
julolo
  • 47
  • 1
  • 5
  • Did you imported it as Gradle project via _File > Import...: Gradle > Existing Gradle Project_? – howlger Feb 08 '21 at 09:50
  • 1
    Duplicate of [i have problem for setting java environment in windows](https://stackoverflow.com/questions/66023129/i-have-problem-for-setting-java-environment-in-windows) – thokuest Feb 08 '21 at 19:35

0 Answers0