1. 程式人生 > >gradle bootrun 熱部署無效,springboot2.0熱部署

gradle bootrun 熱部署無效,springboot2.0熱部署

問題描述

使用gradle run無法熱部署

版本描述

gradle4,springboot2

解決過程

使用gradle bootrun熱部署

注意點

還是需要匯入

compile(‘org.springframework.boot:spring-boot-devtools’)

這個開發者包另外請將

bootRun{
    sourceResources sourceSets.main
}

新增到build.gradle檔案尾部否則會報

* What went wrong:
A problem occurred evaluating root project 'coursewareweb'
. > Could not find method bootRun() for arguments [build_ez5ztenpe2qvebnxqgh94tjwp$_run_closure2@33ffa8ad] on root project 'coursewareweb' of type org.gradle.api.Project. * 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 CONFIGURE FAILED in 0s Could not find method bootRun() for arguments [build_ez5ztenpe2qvebnxqgh94tjwp$_run_closure2@33ffa8ad] on root project 'coursewareweb' of type org.gradle.api.Project. Open File

這就和gradle載入順序有關感興趣的朋友深入研究一下