我有这样的 build.gradle
并且它有效:
plugins {
id 'org.springframework.boot' version '2.5.8' apply false
...
}
...
springBoot {
mainClassName = 'com.mir3.service.contactfileparser.Main'
}
但是如果我将 spring boot 版本升级到 2.6.2,它会失败并出现错误:
plugins {
id 'org.springframework.boot' version '2.6.2' apply false
...
}
...
springBoot {
mainClassName = 'com.mir3.service.contactfileparser.Main'
}
错误文本是:
A problem occurred evaluating root project 'myProject'.
> Could not set unknown property 'mainClassName' for extension 'springBoot' of type org.springframework.boot.gradle.dsl.SpringBootExtension.
我该如何解决?从 2.5.8 迁移到 2.6.2 的正确方法是什么?