Since version 0.0.24 Gretty supports Spring Boot web-apps out-of-the-box. All Gretty features, including (but not limited to) debugging, code coverage and integration tests, also apply to spring-boot web-apps. See more information below.

Simplest Gretty setup with Spring Boot

Add the following code to "build.gradle":

buildscript {
  repositories {
    jcenter()
  }

  dependencies {
    classpath 'org.gretty:gretty:+'
  }
}

apply plugin: 'org.gretty'

repositories {
  jcenter()
}

gretty {
  springBoot = true
}

Now you can run your Spring Boot application with the command gradle appRun.

The complete sources for the simplest Gretty Spring Boot setup:

Running on specific version of spring boot

Add the following code to "build.gradle":

buildscript {
  repositories {
    jcenter()
    maven { url 'http://repo.spring.io/release' }
  }

  dependencies {
    classpath 'org.gretty:gretty:+'
  }
}

apply plugin: 'org.gretty'

repositories {
  jcenter()
  maven { url 'http://repo.spring.io/release' }
}

gretty {
  springBoot = true
  springBootVersion = '1.1.7.RELEASE'
}

Note that spring-boot versions prior to 1.1.0 are not supported by Gretty and may produce compile-time or runtime errors.

Gretty configuration and Spring Boot

Gretty configuration also applies to spring-boot projects. You can set properties like "contextPath", "port", etc. etc. - they all will be passed to the servlet container and web-app.

Gretty tasks and Spring Boot

Gretty plugin implements all gretty tasks for spring-boot projects.

Gretty hot-deployment and Spring Boot

Gretty uses spring-loaded library for smooth reload of running Spring Boot applications. As soon as you change the sources, the project gets automatically recompiled and web-app reloads with updated classes.

Gretty also supports Fast reload feature with Spring Boot web-apps.

Gretty webapp-overlays and Spring Boot

Webapp-overlays are technically possible with Gretty and Spring Boot, but author of Gretty plugin did not test this feature yet. See more information in Web-app overlays section.

Gretty HTTPS support and Spring Boot

Gretty fully supports HTTPS with Spring Boot web-apps.

Gretty debugging, testing, logging and Spring Boot

Gretty fully supports debugging of Spring Boot web-apps.

Gretty fully supports integration tests with Spring Boot web-apps.

Gretty fully supports Jacoco code coverage with Spring Boot web-apps.

Gretty fully supports logging of Spring Boot web-apps.

Gretty Jetty-specific features and Spring Boot

Gretty fully supports Jetty security realms with Spring Boot web-apps.

Gretty fully supports jetty.xml with Spring Boot web-apps.

Gretty fully supports jetty-env.xml with Spring Boot web-apps.

Gretty Tomcat-specific features and Spring Boot

Gretty fully supports Tomcat security realms with Spring Boot web-apps.

Gretty multiple web-apps and Spring Boot

Gretty supports running multiple web-apps on so-called farms. Web-apps can be Spring Boot or "normal", in any combinations - Gretty will sort them out.

Gretty contains example program, showing multi-web-app setup with Spring Boot:

Servlet container versions and Spring Boot

Gretty supports running Spring Boot web-apps on Jetty 8/9 and Tomcat 7/8. Running Spring Boot on Jetty 7 is not supported, since Jetty 7 uses older servlet API not compatible with Spring Boot.

The servlet container for Spring Boot web-apps is selected via servletContainer property of Gretty configuration.