Using @Value for non-existing environment variable will cause an IllegalArgumentException: Could not resolve placeholder 'ENV_VAR' in string value "${ENV_VAR}".
For example:
@Autowired
public SomeClass(@Value("{ENV_VAR}") final String value) { }
How can I make this value optional?