Export Spring Boot application as a JAR file in eclipse

I am using Spring STS in Eclipse to create a simple spring loading web project. I can run it normally in Eclipse, but when I try to export it as a JAR file, I get:

rg.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

Mine public static void mainis in Application.javawith annotation @SpringBootApplication.

I double-checked all Maven dependencies a hundred times.

What am I doing wrong?

+6
source share
2 answers

, Eclipse , , . "" ( ) , Spring Boot Maven Gradle "" .

-, , repackage, , Maven package. - mvn package ( Maven CLI ); POM Eclipse " " Maven Eclipse.

+15

7/10 ​​ ( ). Eclipse IDE POM maven, maven. ON cmd.exe .

mvnw clean package

unix

./mvnw clean package

, . mvnw maven maven, maven, .mvn .

D:\workspace\Zuteller Workspace\zusteller>mvnw clean package

zusteller-0.0.1-SNAPSHOT.jar target .

D:\workspace\Zuteller Workspace\zusteller>java -jar target\zusteller-0.0.1-SNAPSHOT.jar

( Tomcat) localhost: 8080/

+1

All Articles