Monthly Archives: March 2014

Setting a Tomcat version with Spring Boot and Gradle

Spring Boot allows you to easily specify a tomcat version when using Maven (Docs). But there doesn’t seem to be an equivalent mechanism for Gradle.

To lock down a specific tomcat version for war deployment, I found that I had to exclude the starter-tomcat module and add the dependencies specified in the tomcat starter POM in my Spring Boot project’s build.gradle file.

compile('org.springframework.boot:spring-boot-starter-web:1.0.0.RC4'){
   exclude module: spring-boot-starter-tomcat
}
providedRuntime 'org.apache.tomcat.embed:tomcat-embed-core:7.0.52'
providedRuntime 'org.apache.tomcat.embed:tomcat-embed-el:7.0.52'
providedRuntime 'org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.52'
providedRuntime 'org.apache.tomcat:tomcat7-websocket:7.0.52'

Note: embed-el doesn’t seem to be included in versions below 7.0.52.

I imagine a similar approach would be needed to use Jetty 9.

Advertisements

Building Web Content Jars for Spring Boot with Gradle

The Javascript world contains a rich ecosystem of tools for building and testing web applications.

In this post, I will show you how you can use content jar files to separate the front-end development experience for your Spring Boot projects while still keeping your deployments simple.

Continue reading