Tag Archives: Gradle Packages Springboot Error

Gradle Packages Springboot Error: no main manifest attribute, in ./build/libs/scaffold-1.0-SNAPSHOT.jar

The reason for the error is that the build. Gradle file is missing the package plug-in for gradle

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'
}

Just patch spring-boot-gradle-plugin.

Verification.

./gradlew build

$ java -jar ./build/libs/scaffold-1.0-SNAPSHOT.jar

Then you can see the program get up.