79804752

Date: 2025-10-30 12:27:36
Score: 2.5
Natty:
Report link

Thanks, that's what I was missing, I thought @Value was exclusive to env vars and props, apparently Spring does inject command line args

except, it looks like it works in this format

-Dspring-boot.run.arguments="--p=foo"

with

@Value("${p}")
String p;

Thanks again!

This is much more straightforward

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Low length (0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Value
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Iqbal