2

I setup up a simple web project in spring boot with only the compile("org.springframework.boot:spring-boot-starter-web") dependency . When I used gradlew bootRun, the application starts up and I am able to get the webpage. If a fat jar is created either manually or through shadow plugin, the jar file refuses to start citing EmbeddedServletContainerFactory missing. Am I missing some other dependencies. The jar task is modified as

jar {
    from { configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } }
}
Matteo
  • 37,680
  • 11
  • 100
  • 115
Vinod R
  • 1,218
  • 10
  • 13
  • What task are you running to create the jar? In order for the Spring Boot to create the uber-jar (containing the embedded servlet container), you need to run `gradle build`. – geoand Jul 09 '14 at 06:07
  • I was using gradle jar, thanks for pointing it out. Please post your answer for me to close the question. – Vinod R Jul 09 '14 at 06:11

1 Answers1

3

In order for the Spring Boot to create the uber-jar (containing the embedded servlet container), you need to run gradle build.

geoand
  • 60,071
  • 24
  • 172
  • 190