Spring Boot "no main manifest attribute" running the jar in CI
The jar you ran has no Main-Class in its manifest. This happens when CI runs the plain library jar instead of the repackaged executable Spring Boot jar produced by bootJar or spring-boot:repackage.
What this error means
A java -jar step fails with "no main manifest attribute, in build/libs/app.jar" and exits immediately.
Spring Boot
no main manifest attribute, in build/libs/app-0.0.1-SNAPSHOT-plain.jarCommon causes
The plain jar was run, not the bootJar
Gradle produces both an executable jar and a -plain.jar; running the plain one has no launcher manifest.
Repackaging did not run
With Maven, the app was packaged without the spring-boot-maven-plugin repackage goal, so the jar is not executable.
How to fix it
Run the executable bootJar
Point java -jar at the repackaged jar, not the -plain one.
Terminal
./gradlew bootJar
java -jar build/libs/app-0.0.1-SNAPSHOT.jarEnsure Maven repackages the jar
Include the Spring Boot plugin so mvn package produces an executable jar.
pom.xml
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>How to prevent it
- Run the bootJar/repackaged artifact, never the -plain jar.
- Keep the Spring Boot build plugin configured so repackaging happens.
- Name the artifact explicitly in the run step to avoid picking the wrong jar.
Related guides
Spring Boot bootRun blocking the CI job (never exits) in CIFix a Spring Boot CI step that hangs because ./gradlew bootRun (or mvn spring-boot:run) starts a long-running…
Spring Boot "APPLICATION FAILED TO START" in CIFix the Spring Boot "APPLICATION FAILED TO START" banner in CI - the failure analyzer prints a Description an…
Spring Boot "Web server failed to start. Port 8080 was already in use" in CIFix Spring Boot "Web server failed to start. Port 8080 was already in use." in CI - a previous app or a paral…