<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Spring Boot on SivaLabs</title><link>https://www.sivalabs.in/categories/spring-boot/</link><description>Recent content in Spring Boot on SivaLabs</description><generator>Hugo</generator><language>en</language><lastBuildDate>Wed, 02 Sep 2026 09:43:03 +0530</lastBuildDate><atom:link href="https://www.sivalabs.in/categories/spring-boot/index.xml" rel="self" type="application/rss+xml"/><item><title>Spring Boot Tips: Easiest Way To Provide Environment Variables</title><link>https://www.sivalabs.in/blog/spring-boot-tips-easiest-way-to-provide-env-vars/</link><pubDate>Wed, 02 Sep 2026 06:00:00 +0530</pubDate><guid>https://www.sivalabs.in/blog/spring-boot-tips-easiest-way-to-provide-env-vars/</guid><description>&lt;p&gt;Spring Boot has excellent support for &lt;a href="https://docs.spring.io/spring-boot/reference/features/external-config.html"&gt;externalized configuration&lt;/a&gt;.
You can supply configuration through properties files, YAML files, environment variables, command-line arguments, and several other sources.&lt;/p&gt;


&lt;svg width="0" height="0" display="none" xmlns="http://www.w3.org/2000/svg"&gt;
 &lt;symbol id="tip-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;
 &lt;path
 d="M504 256c0 136.967-111.033 248-248 248S8 392.967 8 256 119.033 8 256 8s248 111.033 248 248zM227.314 387.314l184-184c6.248-6.248 6.248-16.379 0-22.627l-22.627-22.627c-6.248-6.249-16.379-6.249-22.628 0L216 308.118l-70.059-70.059c-6.248-6.248-16.379-6.248-22.628 0l-22.627 22.627c-6.248 6.248-6.248 16.379 0 22.627l104 104c6.249 6.249 16.379 6.249 22.628.001z"/&gt;
 &lt;/symbol&gt;
 &lt;symbol id="important-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;
 &lt;path
 d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zm-248 50c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/&gt;
 &lt;/symbol&gt;
 &lt;symbol id="warning-box" viewBox="0 0 576 512" preserveAspectRatio="xMidYMid meet"&gt;
 &lt;path
 d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/&gt;
 &lt;/symbol&gt;
 &lt;symbol id="info-box" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet"&gt;
 &lt;path
 d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/&gt;
 &lt;/symbol&gt;
&lt;/svg&gt;&lt;div class="box box-shortcode info" &gt;
 &lt;span class="icon-box baseline"&gt;
 &lt;svg&gt;&lt;use href="#info-box"&gt;&lt;/use&gt;&lt;/svg&gt;
 &lt;/span&gt;
 &lt;p&gt;&lt;strong&gt;Spring Boot Configuration Management Best Practices&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Explore &lt;a href="https://blog.jetbrains.com/idea/2026/08/spring-boot-configuration-management-best-practices/"&gt;Spring Boot Configuration Management Best Practices&lt;/a&gt; to learn more.&lt;/p&gt;
 &lt;/div&gt;

&lt;p&gt;That flexibility is useful, but local development still presents a small annoyance: where should you define environment variables?&lt;/p&gt;
&lt;p&gt;You could export them from &lt;code&gt;.bashrc&lt;/code&gt; or &lt;code&gt;.zshrc&lt;/code&gt;, but then they affect every terminal session.
You could configure them in your IDE, but each run configuration and each developer may need the same setup.&lt;/p&gt;
&lt;p&gt;For local development, I usually prefer a small file in the project directory.&lt;/p&gt;</description></item></channel></rss>