At the bottom of our banner.txt
, we have the following
Running Spring Boot ${spring-boot.version} on java ${java.version} in environment ${ccic.environ}
which starts up with
Running Spring Boot 2.0.5.RELEASE on java 1.8.0_144 in environment uat
We had a bit of a scare today because someone noticed it says 1.8.0_144
for the java.version
, however we should be running 1.8.0_131
. After further investigation, we can confirm that we are running with 1.8.0_131
.
I was curious where 1.8.0_144
was coming from. It seems MANIFEST.MF
contains the value of 1.8.0_144
for the key Build-Jdk
, presumably java on the build server is wrong. Is that were spring is reading it from?
It surprises me that java.version
would prefer MANIFEST.MF
over the runtime. Am I off in my thinking? Why is spring boot not returning the correct java version? I tried looking in the spring source, but finding "java.version" or "javaversion" hasn't been helpful.
It turns out the MANIFEST.MF
and spring were both red herrings. We use maven for our builds and we had filtering turned on. The builds were filtering banner.txt
and replacing the value. We used the following configuration to prevent the filtering from occurring to banner.txt
.
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>banner.txt</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
<includes>
<include>banner.txt</include>
</includes>
</resource>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With