Using jettyRunWar or jettyRun in Gradle with a Spring Boot app results in just a directory listing in the browser
gradle, spring, spring-boot
Solution
Did you try `./gradlew bootRun` instead? Normal Spring Boot project has server embedded for easier usage :)
This task requires gradle plugin:
apply plugin: 'spring-boot'
Features
Embed Tomcat or Jetty directly (no need to deploy WAR files)
Task
Execution tasks
---------------
bootRun - Run the executable JAR/WAR
Problem
I'm using Gradle and Spring Boot for the first time. I decided to create a project that actually builds a WAR archive and I'm using the Gradle Jetty plugin. If I run the jettyRun or jettyRunWar tasks, in my browser all I'm seeing is a directory listing, not my actual application. For example, the jettyRunWar task results in a directory listing like this: ``` META-INF/ WEB-INF/ dist/ ``` The dist/ directory contains my static files. Maybe I'm missing something fundamental since I'm using Gradle and Spring Boot for the first time. I'm trying to test my app while making changes to my static files without restarting the app. Here is my build.gradle file. ``` buildscript { repositories { maven { url "http://repo.spring.io/libs-snapshot" } mavenLocal() } dependencies { classpath "org.springframework.boot:spring-boot-gradle-plugin:0.5.0.M6" } } apply plugin: "java" apply plugin: "idea" apply plugin: "spring-boot" apply plugin: "war" war { baseName = "mis-support-client" version = "1.0.0-SNAPSHOT" includes = ["dist/**"] } repositories { mavenCentral() maven { url "http://repo.spring.io/libs-snapshot" } } dependencies { testCompile "junit:junit:4.11" compile ("org.springframework.boot:spring-boot-starter-web:0.5.0.M7") { exclude module: "spring-boot-starter-tomcat" } compile "org.springframework.boot:spring-boot-starter-jetty:0.5.0.M7" compile "org.springframework.boot:spring-boot-starter-security:0.5.0.M7" compile "org.springframework.boot:spring-boot-starter-websocket:0.5.0.M7" compile "javax.inject:javax.inject:1" compile "org.codehaus.jackson:jackson-mapper-asl:1.9.12" compile "org.apache.httpcomponents:httpclient:4.3.1" compile "commons-io:commons-io:2.4" } task wrapper (type: Wrapper) { gradleVersion = "1.8" } ```