-
Notifications
You must be signed in to change notification settings - Fork 40.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot v3.0.13+ Unable to Load Flyway 10.0.0+ licenseKey #39431
Comments
Thanks for the report. The problem that we believe we have fixed is that a failure would occur even if you hadn't set a property. This was due to the use of method references which would reference the method at runtime even if the relevant property hadn't been set. Having replaced those with lambdas, the problem should only occur if you've set a property that isn't compatible with a non-default version of Flyway as that will result in an attempt to call the method. Can you confirm that you're setting |
Hi, Issue Confirmation:I can confirm encountering the reported error when using both the
Furthermore, without the property, the application starts normally, but with the following warning message:
Authentication Information:Referring to various authentication methods documented in the official Flyway documentation, it appears there are multiple ways to authorize Flyway, ordered by precedence:
Since I'm exclusively using the (Note: I also attempted authentication via environment variables, using both public String getConfigurationParameterFromEnvironmentVariable(String environmentVariable) {
return "FLYWAY_LICENSE_KEY".equals(environmentVariable) ? "flyway.licenseKey" : null;
} Flyway Ticket:If it can help to better explain the error I'm facing, below is the ticket I opened to the Flyway support team: Configuration via .properties file:spring.flyway.licenseKey=FL01... The issue arises due to the removal of the API Configuration:Flyway flyway = Flyway.configure().load();
flyway.getConfigurationExtension(LicensingConfigurationExtension.class).setLicenseKey("FL01..."); In this scenario, the issue arises because the public void setLicenseKey(String licenseKey) {
LOG.warn("Attempting to set a license key in Flyway open-source. Redgate features will not be available. Download Redgate Flyway at [https://rd.gt/3GGIXhh](https://rd.gt/3GGIXhh)");
} Consequently, when attempting to set the license key through the API configuration, a warning log is generated as follows: However, despite the warning, no authorization is actually performed. |
Thanks for the clarification.
Unfortunately, that's not an expectation that we will meet. You're overriding Boot's default version of Flyway to a new major version that contains breaking changes in how the license key is configured. The earliest that we could adapt to that would be when we start using Flyway 10 by default but I'm not sure it will be possible as we won't have access to You should remove the |
Problem Description:
The issue #38164 persists even after the fix released in Spring Boot 3.0.13 (v3.0.13 release note). The issue arises with Flyway versions 10.0.0 and above.
I have tested this issue with Spring Boot versions 3.0.13, 3.2.0, and the latest 3.2.2, alongside redgate flyway-core library versions 10.0.0 and the latest 10.7.1.
Issue Description:
The issue lies within the Spring Boot inner class
FlywayConfiguration.class
(FlywayAutoConfiguration$FlywayConfiguration.class
), which attempts to invoke the methodlicenseKey(String)
of theFluentConfiguration
class within Flyway:org.flywaydb.core.api.configuration.FluentConfiguration.licenseKey(java.lang.String)
.However, Flyway versions 10.0.0 and above have removed the
licenseKey(String)
method from theFluentConfiguration
class. The minimum available version ofcom.redgate.flyway flyway-core
is 10.0.0.The resolution implemented in Spring Boot 3.0.13 (issues #38164 and #38266) primarily involves a syntax adjustment, transitioning from method reference to lambda expression. However, despite this modification, the underlying functionality remains unchanged. As a result, the issue continues to persist:
Before the fix (Spring Boot v3.0.0):
After the fix (Spring Boot v3.0.13):
However,
configuration
is an instance of theFluentConfiguration
class, which no longer includes thelicenseKey(String)
method after the upgrade toredgate flyway
version 10.0.0.The text was updated successfully, but these errors were encountered: