Move code from spring-boot-actuator to spring-boot-flyway

This commit is contained in:
Andy Wilkinson
2025-05-09 16:25:21 +01:00
committed by Phillip Webb
parent 792314c2ec
commit 8190edfe28
8 changed files with 12 additions and 12 deletions

View File

@@ -19,12 +19,12 @@ package org.springframework.boot.actuate.autoconfigure.flyway;
import org.flywaydb.core.Flyway;
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
* @since 2.0.0
*/
@AutoConfiguration(after = FlywayAutoConfiguration.class)
@ConditionalOnClass(Flyway.class)
@ConditionalOnClass({ Flyway.class, FlywayEndpoint.class })
@ConditionalOnAvailableEndpoint(FlywayEndpoint.class)
public class FlywayEndpointAutoConfiguration {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,8 +19,8 @@ package org.springframework.boot.actuate.autoconfigure.flyway;
import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
import static org.assertj.core.api.Assertions.assertThat;

View File

@@ -24,8 +24,8 @@ import org.flywaydb.core.api.MigrationState;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
import org.springframework.context.ApplicationContext;

View File

@@ -24,7 +24,6 @@ dependencies {
dockerTestImplementation("org.testcontainers:testcontainers")
optional(project(":spring-boot-project:spring-boot-activemq"))
optional(project(":spring-boot-project:spring-boot-flyway"))
optional(project(":spring-boot-project:spring-boot-http-converter"))
optional(project(":spring-boot-project:spring-boot-jdbc"))
optional(project(":spring-boot-project:spring-boot-jetty"))

View File

@@ -13,6 +13,7 @@ dependencies {
api(project(":spring-boot-project:spring-boot-jdbc"))
api("org.flywaydb:flyway-core")
optional(project(":spring-boot-project:spring-boot-actuator"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
optional("org.flywaydb:flyway-database-oracle")
optional("org.flywaydb:flyway-database-postgresql")

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.flyway;
package org.springframework.boot.flyway.actuate.endpoint;
import java.time.Instant;
import java.util.Date;
@@ -39,7 +39,7 @@ import org.springframework.context.ApplicationContext;
* @author Phillip Webb
* @author Andy Wilkinson
* @author Artsiom Yudovin
* @since 2.0.0
* @since 4.0.0
*/
@Endpoint(id = "flyway")
public class FlywayEndpoint {

View File

@@ -15,6 +15,6 @@
*/
/**
* Actuator support for Flyway.
* Actuator endpoint for Flyway.
*/
package org.springframework.boot.actuate.flyway;
package org.springframework.boot.flyway.actuate.endpoint;

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.flyway;
package org.springframework.boot.flyway.actuate.endpoint;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.flyway.FlywayEndpoint.FlywayDescriptor;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint.FlywayDescriptor;
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
import org.springframework.boot.flyway.autoconfigure.FlywayMigrationStrategy;
import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration;