Skip to content

Commit 81c6590

Browse files
bclozelwilkinsona
authored andcommitted
Create spring-boot-mail module
1 parent 79e6b84 commit 81c6590

File tree

28 files changed

+87
-41
lines changed

28 files changed

+87
-41
lines changed

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ include "spring-boot-project:spring-boot-docker-compose"
5151
include "spring-boot-project:spring-boot-docs"
5252
include "spring-boot-project:spring-boot-jackson"
5353
include "spring-boot-project:spring-boot-jetty"
54+
include "spring-boot-project:spring-boot-mail"
5455
include "spring-boot-project:spring-boot-parent"
5556
include "spring-boot-project:spring-boot-reactor-netty"
5657
include "spring-boot-project:spring-boot-test"

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies {
2020
optional(project(":spring-boot-project:spring-boot-amqp"))
2121
optional(project(":spring-boot-project:spring-boot-jackson"))
2222
optional(project(":spring-boot-project:spring-boot-jetty"))
23+
optional(project(":spring-boot-project:spring-boot-mail"))
2324
optional(project(":spring-boot-project:spring-boot-reactor-netty"))
2425
optional(project(":spring-boot-project:spring-boot-tomcat"))
2526
optional(project(":spring-boot-project:spring-boot-undertow"))

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
2727
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2828
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
29-
import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration;
29+
import org.springframework.boot.mail.autoconfigure.MailSenderAutoConfiguration;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.mail.javamail.JavaMailSenderImpl;
3232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration;
2222
import org.springframework.boot.actuate.mail.MailHealthIndicator;
2323
import org.springframework.boot.autoconfigure.AutoConfigurations;
24-
import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration;
24+
import org.springframework.boot.mail.autoconfigure.MailSenderAutoConfiguration;
2525
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
2626

2727
import static org.assertj.core.api.Assertions.assertThat;

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,13 +1648,6 @@
16481648
"name": "spring.liquibase.ui-service",
16491649
"defaultValue": "logger"
16501650
},
1651-
{
1652-
"name": "spring.mail.test-connection",
1653-
"description": "Whether to test that the mail server is available on startup.",
1654-
"sourceType": "org.springframework.boot.autoconfigure.mail.MailProperties",
1655-
"type": "java.lang.Boolean",
1656-
"defaultValue": false
1657-
},
16581651
{
16591652
"name": "spring.mustache.prefix",
16601653
"defaultValue": "classpath:/templates/"

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration
7777
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
7878
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
7979
org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration
80-
org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration
81-
org.springframework.boot.autoconfigure.mail.MailSenderValidatorAutoConfiguration
8280
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
8381
org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration
8482
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration

spring-boot-project/spring-boot-dependencies/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@ bom {
20382038
"spring-boot-loader",
20392039
"spring-boot-loader-classic",
20402040
"spring-boot-loader-tools",
2041+
"spring-boot-mail",
20412042
"spring-boot-properties-migrator",
20422043
"spring-boot-reactor-netty",
20432044
"spring-boot-starter",

spring-boot-project/spring-boot-docs/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ dependencies {
5757
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
5858
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "autoConfigurationMetadata"))
5959
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "autoConfigurationMetadata"))
60+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata"))
6061
autoConfiguration(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "autoConfigurationMetadata"))
6162
autoConfiguration(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "autoConfigurationMetadata"))
6263
autoConfiguration(project(path: ":spring-boot-project:spring-boot-tomcat", configuration: "autoConfigurationMetadata"))
@@ -72,6 +73,7 @@ dependencies {
7273
configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata"))
7374
configurationProperties(project(path: ":spring-boot-project:spring-boot-jackson", configuration: "configurationPropertiesMetadata"))
7475
configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata"))
76+
configurationProperties(project(path: ":spring-boot-project:spring-boot-mail", configuration: "configurationPropertiesMetadata"))
7577
configurationProperties(project(path: ":spring-boot-project:spring-boot-reactor-netty", configuration: "configurationPropertiesMetadata"))
7678
configurationProperties(project(path: ":spring-boot-project:spring-boot-test-autoconfigure", configuration: "configurationPropertiesMetadata"))
7779
configurationProperties(project(path: ":spring-boot-project:spring-boot-testcontainers", configuration: "configurationPropertiesMetadata"))

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/email.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ TIP: See the {url-spring-framework-docs}/integration/email.html[reference docume
77

88
If `spring.mail.host` and the relevant libraries (as defined by `spring-boot-starter-mail`) are available, a default javadoc:org.springframework.mail.javamail.JavaMailSender[] is created if none exists.
99
The sender can be further customized by configuration items from the `spring.mail` namespace.
10-
See javadoc:org.springframework.boot.autoconfigure.mail.MailProperties[] for more details.
10+
See javadoc:org.springframework.boot.mail.autoconfigure.MailProperties[] for more details.
1111

1212
In particular, certain default timeout values are infinite, and you may want to change that to avoid having a thread blocked by an unresponsive mail server, as shown in the following example:
1313

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
plugins {
2+
id "java-library"
3+
id "org.springframework.boot.auto-configuration"
4+
id "org.springframework.boot.configuration-properties"
5+
id "org.springframework.boot.docker-test"
6+
id "org.springframework.boot.deployed"
7+
id "org.springframework.boot.optional-dependencies"
8+
}
9+
10+
description = "Spring Boot Mail"
11+
12+
dependencies {
13+
api(project(":spring-boot-project:spring-boot"))
14+
api("org.springframework:spring-context-support")
15+
api("org.eclipse.angus:jakarta.mail")
16+
17+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
18+
19+
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
20+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
21+
dockerTestImplementation("org.assertj:assertj-core")
22+
dockerTestImplementation("org.awaitility:awaitility")
23+
dockerTestImplementation("org.junit.jupiter:junit-jupiter")
24+
dockerTestImplementation("org.testcontainers:junit-jupiter")
25+
dockerTestImplementation("org.testcontainers:testcontainers")
26+
27+
testImplementation(project(":spring-boot-project:spring-boot-test"))
28+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
29+
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
30+
testImplementation("org.assertj:assertj-core")
31+
testImplementation("org.awaitility:awaitility")
32+
testImplementation("org.junit.jupiter:junit-jupiter")
33+
testImplementation("org.mockito:mockito-core")
34+
testImplementation("org.mockito:mockito-junit-jupiter")
35+
36+
testRuntimeOnly("ch.qos.logback:logback-classic")
37+
}

0 commit comments

Comments
 (0)