产生错误缘由是由于build.gradle文件缺乏了gradle的打包插件java
buildscript { dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:2.2.6.RELEASE") } } plugins { id 'java' } apply plugin: 'java' apply plugin: 'org.springframework.boot' group 'com.guanguan.docker' version '1.0-SNAPSHOT' sourceCompatibility = 1.8 repositories { mavenCentral() } dependencies { compile('org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE') testCompile group: 'junit', name: 'junit', version: '4.12' }
补上spring-boot-gradle-plugin便可。web
验证:spring
./gradlew builddocker
$ java -jar ./build/libs/scaffold-1.0-SNAPSHOT.jarapp
而后就能看到程序起起来了。maven