Spring-boot-maven-plugin cannot find main class.

Answered

My apllication uses Spring Boot. I tried to connect my application to IBM bluemix. There were several errors -> "Error: Could not find or load main class class". I started to look for some places in my code where this fail could appered. Bluemix uses war so my application make .war not .jar.  I found strange think in war file in MANIFEST.MF.

Sentence under red string is "Cannot resolve class "${start-class}.

I think this is the place, which destroy process od deploying in bluemix. I red, that spring-boot-maven-plugin is responsible  for creating this MANIFEST.mf. I tried a lot change this manifest, but I suppose, I hit wall. I nedd to add, that with the same application on STS Eclipse there wasn't problem, and application was deployed on bluemix.

This is github address with code:https://github.com/jagodnik/demo.

0
3 comments

I cannot reproduce the problem using war:war target via Maven. Screenshots looks like you created the WAR file/MAINFEST.MF via IDE itself, not Maven.

Try to execute clean:clean in Maven again to make sure everything is rebuilt from scratch.

0
Avatar
Permanently deleted user

Sorry, but I forget show how I run this application. I added 'Build 'demo:war exploded' artifact" to standard Run Configuration of SpringBoot:

http://imgur.com/a/WEiQM 

Do you think, that directly using Maven (from cmd) is better way to creating war file, then creating Run Configuration in IDE?

0

Unless you want to replicate every single step that Maven war:war target does incl. behind the scene "magic", then yes.

0

Please sign in to leave a comment.