Pass a YAML-based property value to @Scheduled annotation in Spring Boot
<p>This question is possibly a duplicate of this older <a href="https://stackoverflow.com/questions/27445702/inject-scheduled-fixedrate-value-from-spring-boot-application-yml-file">question</a>.</p>

<p>I'm working on a <strong>Spring Boot 1.4</strong> application and I have a method of a bean annotated with <code>@Scheduled</code>.
I need to pass the cron value to the annotation and, since I'm using YAML based configuration, the cron value is stored in the YAML file (<code>application.yaml</code>).</p>

<p>I can't find a way to pass the property value <code>app.cron</code> to the annotation.</p>

<p>For instance, this doesn't work</p>

<pre><code>@Scheduled(cron = ${app.cron})
</code></pre>

<p>I have also tried to use EL expression, but no luck.</p>

<p>What is the proper way to pass a YAML based property value to a Spring annotation?</p>