Browse Source

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

Closes gh-46079
pull/46230/head
Andy Wilkinson 10 months ago
parent
commit
bb79cde964
  1. 2
      spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle
  2. 6
      spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  3. 1
      spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  4. 2
      spring-boot-project/spring-boot-mail/build.gradle
  5. 6
      spring-boot-project/spring-boot-mail/src/main/java/org/springframework/boot/mail/actuate/health/autoconfigure/MailHealthContributorAutoConfiguration.java
  6. 4
      spring-boot-project/spring-boot-mail/src/main/java/org/springframework/boot/mail/actuate/health/autoconfigure/package-info.java
  7. 6
      spring-boot-project/spring-boot-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json
  8. 3
      spring-boot-project/spring-boot-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  9. 2
      spring-boot-project/spring-boot-mail/src/test/java/org/springframework/boot/mail/actuate/health/autoconfigure/MailHealthContributorAutoConfigurationTests.java

2
spring-boot-project/spring-boot-actuator-autoconfigure-all/build.gradle

@ -61,7 +61,6 @@ dependencies { @@ -61,7 +61,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"))
@ -137,7 +136,6 @@ dependencies { @@ -137,7 +136,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"
}

6
spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -65,12 +65,6 @@ @@ -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",

1
spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -20,7 +20,6 @@ org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoCon @@ -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

2
spring-boot-project/spring-boot-mail/build.gradle

@ -33,7 +33,7 @@ dependencies { @@ -33,7 +33,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"))

6
spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/mail/MailHealthContributorAutoConfiguration.java → spring-boot-project/spring-boot-mail/src/main/java/org/springframework/boot/mail/actuate/health/autoconfigure/MailHealthContributorAutoConfiguration.java

@ -14,7 +14,7 @@ @@ -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; @@ -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

4
spring-boot-project/spring-boot-actuator-autoconfigure-all/src/main/java/org/springframework/boot/actuate/autoconfigure/mail/package-info.java → spring-boot-project/spring-boot-mail/src/main/java/org/springframework/boot/mail/actuate/health/autoconfigure/package-info.java

@ -15,6 +15,6 @@ @@ -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;

6
spring-boot-project/spring-boot-mail/src/main/resources/META-INF/additional-spring-configuration-metadata.json

@ -1,6 +1,12 @@ @@ -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.",

3
spring-boot-project/spring-boot-mail/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@ -1,2 +1,3 @@ @@ -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

2
spring-boot-project/spring-boot-actuator-autoconfigure-all/src/test/java/org/springframework/boot/actuate/autoconfigure/mail/MailHealthContributorAutoConfigurationTests.java → spring-boot-project/spring-boot-mail/src/test/java/org/springframework/boot/mail/actuate/health/autoconfigure/MailHealthContributorAutoConfigurationTests.java

@ -14,7 +14,7 @@ @@ -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;
Loading…
Cancel
Save