問題現象:
Task 'run' not found in root project 'springframework'.

問題原因:
沒有在gradle.build文件中添加如下配置,
mainClassName 是 application 的一個屬性,需要一起使用。
apply plugin: 'application' mainClassName = 'hello.HelloWorld'
類似問題:
https://discuss.gradle.org/t/task-run-not-found-in-root-project/12130
I figured it out: my gradle.build did not have the line
apply plugin: 'application'
