Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

344
Vistas
org.gradle.initialization.DefaultSettings_Decorated cannot be cast to org.gradle.api.internal.project.ProjectInternal

I tried to create spring boot application:

I selected components I need from https://start.spring.io/

Now I want to build the application and it fall downs:

FAILURE: Build failed with an exception.

* Where: 
Settings file 'D:\objectsharingsystem\settings.gradle' line: 2

* What went wrong:
A problem occurred evaluating settings 'object-sharing-system'.
> Failed to apply plugin [id 'org.gradle.java']
   > org.gradle.initialization.DefaultSettings_Decorated cannot be cast to org.gradle.api.internal.project.ProjectInternal

* Try:   
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

settings.gradle:

rootProject.name = 'object-sharing-system'
apply plugin: 'java'
compileJava {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
}

build.gradle:

buildscript {
    ext {
        springBootVersion = '2.0.0.BUILD-SNAPSHOT'
    }
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'java'
apply plugin: 'org.springframework.boot'

version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-jdbc')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile('org.springframework.boot:spring-boot-starter-validation')
    compile('org.springframework.boot:spring-boot-starter-web')
    runtime('com.microsoft.sqlserver:mssql-jdbc')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

Please help to find mistake.

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

settings.gradle can not handle application of Project level plugin.

Remove apply plugin and compileJava from settings.gradle. You already have your sourceCompatibility set in build.gradle

about 4 years ago · Santiago Trujillo Denunciar

0

See here where it says

method calls within the settings file is delegated to a settings object. Look at the Settings class in the API documentation for more information.

Unlike build.gradle, the apply method in settings.gradle expects a Plugin<Settings> and not a Plugin<Project>. The java plugin is a Plugin<Project> and can't be applied like this in settings.gradle

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda