Could not set unknown property 'mainClass' for object of type org.springframework.boot.gradle.dsl.SpringBootExtension

0

Mam główny plik build.gradle dla projektu

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${spring_boot_version}")
    }
}

def javaProjects = subprojects.findAll {
    it.name in ["common", "core", "web", "app"]
}

allprojects {
    apply plugin: 'idea'
    apply plugin: 'eclipse'

    repositories {
        jcenter()
    }
}

idea {
    project {
        jdkName = "1.8"
        languageLevel = "1.8"
        vcs = "Git"
    }
}

configure(javaProjects) {
    apply plugin: 'java'
    apply plugin: 'io.spring.dependency-management'
    apply plugin: 'findbugs'

    sourceCompatibility = 1.8
    targetCompatibility = 1.8

    dependencies {
        ...
    }
}

i plik build.gradle w module app

apply plugin: 'org.springframework.boot'

dependencies {
    ...
}

springBoot {
    mainClass = "com.web.WebApplication"
}

jar {
    manifest {
        attributes 'Implementation-Title': "Rest-Web-Services",
                'Implementation-Version': "1.0",
                'Main-Class': "com.web.WebApplication"
    }
}

Kiedy używam build w gradle dla tego projektu otrzymuję błąd

FAILURE: Build failed with an exception.

* Where:
Build file '...\REST-Web-Services\app\build.gradle' line: 28

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not set unknown property 'mainClass' for object of type org.springframework.boot.gradle.dsl.SpringBootExtension.

Nie zna właściwości mainClass. Dlaczego?

0

Idź do katalogu gdzie masz ten moduł app i tam uruchom gradle build.

1 użytkowników online, w tym zalogowanych: 0, gości: 1