Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension

gst*_*low 9 java spring-boot spring-boot-gradle-plugin

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'
    }
Run Code Online (Sandbox Code Playgroud)

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'
    }
Run Code Online (Sandbox Code Playgroud)

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.
Run Code Online (Sandbox Code Playgroud)

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

Les*_*iak 24

使用:

springBoot {
    mainClass = 'com.mir3.service.contactfileparser.Main'
}
Run Code Online (Sandbox Code Playgroud)

SpringBootExtension有:

springBoot {
    mainClass = 'com.mir3.service.contactfileparser.Main'
}
Run Code Online (Sandbox Code Playgroud)

mainClassName在 2.4.0 中已被弃用mainClass,并计划在 2.6.0 中删除。它已通过此提交删除:删除已标记为删除的已弃用代码