Spring, Run task once when application started
<p>My application is based on spring boot.
I want to create a task which should be run only once after application has been started. </p>

<p>Currently, I am looking into two solutions:</p>

<ol>
<li><p>Using <code>@Scheduled</code> and boolean property which should determine whether the logic shold be run or not. </p>

<p><code>@Scheduled
public void method(){
  if(method_run_propery){
    //do something;
  }
}
</code></p></li>
<li><p>Using <a href="http://www.quartz-scheduler.org/" rel="noreferrer">Quartz</a>. But I have not used before.</p></li>
</ol>

<p>Please, tell me what is the best approach to use in this case. </p>