Move mail health auto-configuration into spring-boot-mail

This commit is contained in:
Andy Wilkinson
2025-05-19 09:04:19 +01:00
committed by Phillip Webb
parent 33ac838d26
commit 98de3d3cb0
9 changed files with 15 additions and 17 deletions

View File

@@ -44,7 +44,6 @@ dependencies {
optional(project(":spring-boot-project:spring-boot-jetty"))
optional(project(":spring-boot-project:spring-boot-jsonb"))
optional(project(":spring-boot-project:spring-boot-kafka"))
optional(project(":spring-boot-project:spring-boot-mail"))
optional(project(":spring-boot-project:spring-boot-mongodb"))
optional(project(":spring-boot-project:spring-boot-quartz"))
optional(project(":spring-boot-project:spring-boot-r2dbc"))
@@ -120,7 +119,6 @@ dependencies {
optional("org.aspectj:aspectjweaver")
optional("org.cache2k:cache2k-micrometer")
optional("org.cache2k:cache2k-spring")
optional("org.eclipse.angus:angus-mail")
optional("org.eclipse.jetty:jetty-server") {
exclude group: "org.eclipse.jetty.toolchain", module: "jetty-jakarta-servlet-api"
}

View File

@@ -65,12 +65,6 @@
"description": "Whether to enable liveness state health check.",
"defaultValue": false
},
{
"name": "management.health.mail.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable Mail health check.",
"defaultValue": true
},
{
"name": "management.health.mongo.enabled",
"type": "java.lang.Boolean",

View File

@@ -20,7 +20,6 @@ org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoCon
org.springframework.boot.actuate.autoconfigure.logging.LoggersEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.logging.OpenTelemetryLoggingAutoConfiguration
org.springframework.boot.actuate.autoconfigure.logging.otlp.OtlpLoggingAutoConfiguration
org.springframework.boot.actuate.autoconfigure.mail.MailHealthContributorAutoConfiguration
org.springframework.boot.actuate.autoconfigure.management.HeapDumpWebEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.management.ThreadDumpEndpointAutoConfiguration
org.springframework.boot.actuate.autoconfigure.metrics.amqp.RabbitMetricsAutoConfiguration

View File

@@ -16,7 +16,7 @@ dependencies {
compileOnly("com.fasterxml.jackson.core:jackson-annotations")
optional(project(":spring-boot-project:spring-boot-actuator"))
optional(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.mail;
package org.springframework.boot.mail.actuate.health.autoconfigure;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.boot.actuate.autoconfigure.health.CompositeHealthContributorConfiguration;
@@ -34,10 +34,10 @@ import org.springframework.mail.javamail.JavaMailSenderImpl;
* {@link EnableAutoConfiguration Auto-configuration} for {@link MailHealthIndicator}.
*
* @author Johannes Edmeier
* @since 2.0.0
* @since 4.0.0
*/
@AutoConfiguration(after = MailSenderAutoConfiguration.class)
@ConditionalOnClass({ JavaMailSenderImpl.class, MailHealthIndicator.class })
@ConditionalOnClass({ JavaMailSenderImpl.class, MailHealthIndicator.class, ConditionalOnEnabledHealthIndicator.class })
@ConditionalOnBean(JavaMailSenderImpl.class)
@ConditionalOnEnabledHealthIndicator("mail")
public class MailHealthContributorAutoConfiguration

View File

@@ -15,6 +15,6 @@
*/
/**
* Auto-configuration for actuator JavaMail concerns.
* Auto-configuration for JavaMail health integration.
*/
package org.springframework.boot.actuate.autoconfigure.mail;
package org.springframework.boot.mail.actuate.health.autoconfigure;

View File

@@ -1,6 +1,12 @@
{
"groups": [],
"properties": [
{
"name": "management.health.mail.enabled",
"type": "java.lang.Boolean",
"description": "Whether to enable Mail health check.",
"defaultValue": true
},
{
"name": "spring.mail.test-connection",
"description": "Whether to test that the mail server is available on startup.",

View File

@@ -1,2 +1,3 @@
org.springframework.boot.mail.actuate.health.autoconfigure.MailHealthContributorAutoConfiguration
org.springframework.boot.mail.autoconfigure.MailSenderAutoConfiguration
org.springframework.boot.mail.autoconfigure.MailSenderValidatorAutoConfiguration
org.springframework.boot.mail.autoconfigure.MailSenderValidatorAutoConfiguration

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.boot.actuate.autoconfigure.mail;
package org.springframework.boot.mail.actuate.health.autoconfigure;
import org.junit.jupiter.api.Test;