Spring beans are not injected in flyway java based migration : <p>I'm trying to inject component of configuration properties in the flyway migration java code but it always null.</p>

<p>I'm using spring boot with Flyway.</p>

<pre><code>@Component
@ConfigurationProperties(prefix = "code")
public class CodesProp {

    private String codePath;
 }
</code></pre>

<p>Then inside Flyway migration code, trying to autowrire this component as following:</p>

<pre><code>public class V1_4__Migrate_codes_metadata implements SpringJdbcMigration {

@Autowired
private CodesProp codesProp ;
public void migrate(JdbcTemplate jdbcTemplate) throws Exception {
    codesProp.getCodePath();  
}
</code></pre>

<p>Here, codesProp is always null.</p>

<p>Is there any way to inject spring beans inside flyway or make it initialized before flyway bean?</p>

<p>Thank You.</p>
