使用Spring Initializr初始化項目時報Gradle不兼容錯誤(Spring Boot 3.5.0)

運行時出現(xiàn)以下錯誤

Execution failed for task ':com.jiayi.Fluoro.FluoroApplication.main()'.
> Process 'command 'C:\Users\littleGabriel\.jdks\openjdk-23.0.1\bin\java.exe'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 13s
3 actionable tasks: 3 executed

執(zhí)行./gradlew build --warning-mode all查看具體錯誤:

Welcome to Gradle 8.12.1!

Here are the highlights of this release:
 - Enhanced error and warning reporting with the Problems API
 - File-system watching support on Alpine Linux
 - Build and test Swift 6 libraries and apps

For more details see https://docs.gradle.org/8.12.1/release-notes.html

Settings file 'D:\Java\Fluoro\settings.gradle': line 3
Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0. Use assignment ('url = <value>') instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.12.1/userguide/upgrading_version_8.html#groovy_space_assignment_syntax
        at settings_eztmocxweyoal283sy9dmbts5$_run_closure1$_closure2$_closure3.doCall$original(D:\Java\Fluoro\settings.gradle:3)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at settings_eztmocxweyoal283sy9dmbts5$_run_closure1$_closure2.doCall$original(D:\Java\Fluoro\settings.gradle:3)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Settings file 'D:\Java\Fluoro\settings.gradle': line 4
Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0. Use assignment ('url = <value>') instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.12.1/userguide/upgrading_version_8.html#groovy_space_assignment_syntax
        at settings_eztmocxweyoal283sy9dmbts5$_run_closure1$_closure2$_closure4.doCall$original(D:\Java\Fluoro\settings.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at settings_eztmocxweyoal283sy9dmbts5$_run_closure1$_closure2.doCall$original(D:\Java\Fluoro\settings.gradle:4)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

> Configure project :
Build file 'D:\Java\Fluoro\build.gradle': line 18
Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0. Use assignment ('url = <value>') instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.12.1/userguide/upgrading_version_8.html#groovy_space_assignment_syntax
        at build_anefe48letf7m205yk518nb2j$_run_closure2$_closure6.doCall$original(D:\Java\Fluoro\build.gradle:18)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_anefe48letf7m205yk518nb2j$_run_closure2.doCall$original(D:\Java\Fluoro\build.gradle:18)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file 'D:\Java\Fluoro\build.gradle': line 19
Space-assignment syntax in Groovy DSL has been deprecated. This is scheduled to be removed in Gradle 10.0. Use assignment ('url = <value>') instead. Consult the upgrading guide for further information: https://docs.gradle.org/8.12.1/userguide/upgrading_version_8.html#groovy_space_assignment_syntax
        at build_anefe48letf7m205yk518nb2j$_run_closure2$_closure7.doCall$original(D:\Java\Fluoro\build.gradle:19)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_anefe48letf7m205yk518nb2j$_run_closure2.doCall$original(D:\Java\Fluoro\build.gradle:19)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

可以看到是格式的問題巍佑,修改setting.gradlebuild.gradle:

pluginManagement {
    repositories {
        maven { url 'https://repo.spring.io/milestone' }
        maven { url 'https://repo.spring.io/snapshot' }
        gradlePluginPortal()
    }
}
rootProject.name = 'Fluoro'

改為

pluginManagement {
    repositories {
        maven { url='https://repo.spring.io/milestone' }
        maven { url='https://repo.spring.io/snapshot' }
        gradlePluginPortal()
    }
}
rootProject.name = 'Fluoro'
...
repositories {
    mavenCentral()
    maven { url='https://repo.spring.io/milestone' }
    maven { url='https://repo.spring.io/snapshot' }
}
...

改為

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

完成!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末谆奥,一起剝皮案震驚了整個濱河市像寒,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌义辕,老刑警劉巖,帶你破解...
    沈念sama閱讀 217,657評論 6 505
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異萄传,居然都是意外死亡,警方通過查閱死者的電腦和手機蜜猾,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,889評論 3 394
  • 文/潘曉璐 我一進店門秀菱,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人蹭睡,你說我怎么就攤上這事衍菱。” “怎么了肩豁?”我有些...
    開封第一講書人閱讀 164,057評論 0 354
  • 文/不壞的土叔 我叫張陵脊串,是天一觀的道長。 經(jīng)常有香客問我清钥,道長洪规,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,509評論 1 293
  • 正文 為了忘掉前任循捺,我火速辦了婚禮斩例,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘从橘。我一直安慰自己念赶,他們只是感情好础钠,可當我...
    茶點故事閱讀 67,562評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著叉谜,像睡著了一般旗吁。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上停局,一...
    開封第一講書人閱讀 51,443評論 1 302
  • 那天很钓,我揣著相機與錄音,去河邊找鬼董栽。 笑死码倦,一個胖子當著我的面吹牛,可吹牛的內(nèi)容都是我干的锭碳。 我是一名探鬼主播袁稽,決...
    沈念sama閱讀 40,251評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼擒抛!你這毒婦竟也來了推汽?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,129評論 0 276
  • 序言:老撾萬榮一對情侶失蹤歧沪,失蹤者是張志新(化名)和其女友劉穎歹撒,沒想到半個月后,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體诊胞,經(jīng)...
    沈念sama閱讀 45,561評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡栈妆,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,779評論 3 335
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了厢钧。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片鳞尔。...
    茶點故事閱讀 39,902評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖早直,靈堂內(nèi)的尸體忽然破棺而出寥假,到底是詐尸還是另有隱情,我是刑警寧澤霞扬,帶...
    沈念sama閱讀 35,621評論 5 345
  • 正文 年R本政府宣布糕韧,位于F島的核電站,受9級特大地震影響喻圃,放射性物質(zhì)發(fā)生泄漏萤彩。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,220評論 3 328
  • 文/蒙蒙 一斧拍、第九天 我趴在偏房一處隱蔽的房頂上張望雀扶。 院中可真熱鬧,春花似錦、人聲如沸愚墓。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,838評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽浪册。三九已至扫腺,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間村象,已是汗流浹背笆环。 一陣腳步聲響...
    開封第一講書人閱讀 32,971評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留厚者,地道東北人躁劣。 一個月前我還...
    沈念sama閱讀 48,025評論 2 370
  • 正文 我出身青樓,卻偏偏與公主長得像籍救,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子渠抹,可洞房花燭夜當晚...
    茶點故事閱讀 44,843評論 2 354

推薦閱讀更多精彩內(nèi)容