0
votes

I have created a build plan in Bamboo for a Spring-Boot application I am developing. When I deploy and try to start the application I get the following error.

no main manifest attribute, in MyApp.jar

I checked my Manifest.MF file from version control:

Manifest-Version: 1.0
Main-Class: com.applications.MyApplication

Then I checked the Manifest.MF after the build:

Manifest-Version: 1.0
Implementation-Title: Spring Boot Data REST Starter
Implementation-Version: 1.4.0.RELEASE
Archiver-Version: Plexus Archiver
Built-By: bamboo
Specification-Vendor: Pivotal Software, Inc.
Specification-Title: Spring Boot Data REST Starter
Implementation-Vendor-Id: org.springframework.boot
Implementation-Vendor: Pivotal Software, Inc.
Created-By: Apache Maven 3.2.1
Build-Jdk: 1.8.0_60
Specification-Version: 1.4.0.RELEASE
Implementation-URL: http://projects.spring.io/spring-boot/

Note that the Main-Class property is missing.

I am new to *Bamboo by Atlassian and I am using the Bob Swift Atlassian Add-ons - Groovy Tasks which includes the a task for Gradle builds.

Has anyone seen this behavior before? Any ideas on a solution or work around?

1
That's a very odd manifest, it appears to have been copied directly from spring-boot-starter-data-rest. You mention that you're using Gradle but the manifest has been created by Maven. Have you tried a local build and checking what's inside the built jar?Phil Webb
I am using the build.gradle file that Spring Boot/IntelliJ provided. I have made no changes to it. I have run it locally with the same resultsAndrew Soloninka
I have found a work around at Oracle's Java site: docs.oracle.com/javase/tutorial/deployment/jar/appman.html. It is under the section Setting an Entry Point with the JAR Tool.Andrew Soloninka
It is still there just not displayed. Check Your file explorer outside IDE to be sure. Your config is set to java 8. Which version do you have in the build path? Sometimes version mismatch will do this.Nate T

1 Answers

1
votes

The solution to this problem is quite simple. On my system I built my jar with Gradle from the command line and an executable jar was created along with the correct MANIFEST.MF. In Bamboo I used a simple inline script along with Gradle wrapper and I obtained the same results as on my system. In my research I found that IntelliJ misses several key Spring Boot tasks. The big lesson learned here is: "Build from the command line"