If your are spring boot developer then you should know about following things which will improve your productivity as well as product impression. Here are some important spring boot development tips and some important tools and plugin for spring boot application development which will help developer to best practice for spring boot development.

  1. Spring boot Dev Tools

    • Spring boot Dev tools is useful while application development. While writing code every time we should build and run application again and again to check output but Spring boot dev tool provide automatically restart application once code has been changes.
    • Here we can also exclude some resources where we do not requires to restart application. While packing application for production or staging spring boot will automatically remove dependency of spring boot dev tools. For spring boot dev tool configuration.
  2. Profile based development

    • Let try to understand problem first, While developing any application we have multiple environments like Development, Staging, production ect based on our requires those environments have different-different configuration. for example each environment have different username and password to connect database.
    • To solve this problem profile based development requires based on profile spring boot will automatically take configuration. How to configure profile based development is available here.
  3. Spring boot application database migration

    • Application development not only one time process. It’s rapid development. Every time deployment process will not be handle by developers or too much technical person. Database schema changes will be perform frequently based on new feature development and modification of existing features so schema changes will be requires.
    • While changes in schema also should be affected in all environments while application will start. We do not like to handle schema changes manually.
    • Spring boot also provide ways to automatically schema updates while application will start,  It just requires .sql files which contains all schema query and schema migration, and other things will be handle by spring boot or schema update and migration plugins which is supported by spring boot. Here is configuration for database migration
  4. Spring boot view build information in production or staging

    • While application development we are maintaining proper application version in pom.xml and we should maintain it so we can properly identify our build.
    • But It possible to identify which build currently running on production server or staging server.  Using endpoints we can check build information in production or staging server. Here is require configuration related to identify build information.
  5. Spring boot running application PID

  6. Spring boot application default timezone

    • Spring boot application(any java application) will take default timezone as server timezone where application is running but we do not take risk that server also be running on our expected timezone. So here is way to set application default timezone.
  7. Spring boot disable command line properties option

    • Spring boot provide ways to give properties option from command line but some time it may create issue in sense of security so we can also disable command line properties options so if user try to pass options from command line in this case application will not consider those arguments.
    • Enable/Disable command line option is based on our requirement but as a developer we should know about that application should Enable/Disable command line option. Here is article related to disable command line properties option
  8. Spring boot provide packaging application of jar/war

    • Spring boot by default generated as .jar file which also contains embedded tomcat. But spring also provide ways to make bundle of .war file which we can deploy in tomcat manually. Here is Spring boot document to generate war file.
  9. Spring boot management endpoints for production

    • We like to know production server on which our application is running, like current memory, remaining memory, health of service, system or OS configuration we can get so many other information using endpoints. We can also provide security to endpoints so no one can directly access those endpoints without credential.
    • Even custom endpoint also possible based on application requirement. Here is complete document for spring boot management endpoints


Please give your comments and let’s start discussion

Leave a Reply

Your email address will not be published. Required fields are marked *