Last mile problem is ubiquitous. Most of the developers think that the deployment or production readiness is not their cup of tea and stay focussed at getting their output for an input given according to the specification. Usually the last week of the release is chaotic with many dry runs and hot fixes. It is so easy to avoid the last mile problem yet so many people avoid those ways. What if the inertia of setting up build scripts & configuration are taken away? Will it be easier for developers to build ship ready applications?
Spring Boot and Gradle is a great combo to get started in the morning and ship a prototype in the evening. Much of the inertia that is present in writing ant scritps and configuring a spring application is blown away by making very simple entries. Here are some examples that makes the life of a developer easy by eliminating the complexity involved in project setup and deployments.
gradle wrapper – This creates a wrapper script for gradle such that only the first developer who sets the project needs to install or have gradle on their machine. From the next developer onwards who checks out the code, they can start using gradle through gradlew script. No installations required except a JDK and a VCS.
gradle build – If the Spring Boot’s starter web is used then this creates a uber jar with an embedded tomcat and all the library dependencies. All we need to deploy is run ‘java -jar myapp.jar’ in the required locations. Configurations can be overridden either through command line arguments or through external property files.
gradle eclipse or gradle idea – Helps in setting up the project in IDE. Once imported in IDE running a web app in debug mode is just right click, debug application on the main class.
gradle bootRun – Command line way to quickly bring up the application and test it as a whole.
Building a 12 factor app with gradle and spring-boot is very easy and uses less effort. Get the project setup with this and pair it up with a continuous delivery tool, you get a ‘Ship Ready’ application right from the first day of development.