Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

458
Visualizações
Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension

I have build.gradle like this and it works :

plugins {
    id 'org.springframework.boot' version '2.5.8' apply false
    ...
}
...
    springBoot {
        mainClassName = 'com.mir3.service.contactfileparser.Main'
    }

but if I upgrade spring boot version to 2.6.2 it fails with error:

plugins {
    id 'org.springframework.boot' version '2.6.2' apply false
    ...
}
...
    springBoot {
        mainClassName = 'com.mir3.service.contactfileparser.Main'
    }

Error text is:

A problem occurred evaluating root project 'myProject'.
> Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension.

How can I fix it ? What is the proper way to migrate from 2.5.8 to 2.6.2 ?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Use:

springBoot {
    mainClass = 'com.mir3.service.contactfileparser.Main'
}

SpringBootExtension has:

/**
 * Returns the fully-qualified name of the application's main class.
 * @return the fully-qualified name of the application's main class
 * @since 2.4.0
 */
public Property<String> getMainClass() {
    return this.mainClass;
}

mainClassName was deprecated in favour of mainClass in 2.4.0 and was scheduled for removal in 2.6.0. It was removed with this commit: Remove deprecated code flagged for removal

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda