Skip to content

Commit 675427a

Browse files
committed
Create spring-boot-ldap module
1 parent ad29a3c commit 675427a

File tree

38 files changed

+90
-57
lines changed

38 files changed

+90
-57
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ include "spring-boot-project:spring-boot-jooq"
7171
include "spring-boot-project:spring-boot-jpa"
7272
include "spring-boot-project:spring-boot-jsonb"
7373
include "spring-boot-project:spring-boot-kafka"
74+
include "spring-boot-project:spring-boot-ldap"
7475
include "spring-boot-project:spring-boot-liquibase"
7576
include "spring-boot-project:spring-boot-neo4j"
7677
include "spring-boot-project:spring-boot-mail"

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

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
optional(project(":spring-boot-project:spring-boot-jetty"))
3333
optional(project(":spring-boot-project:spring-boot-jsonb"))
3434
optional(project(":spring-boot-project:spring-boot-kafka"))
35+
optional(project(":spring-boot-project:spring-boot-ldap"))
3536
optional(project(":spring-boot-project:spring-boot-liquibase"))
3637
optional(project(":spring-boot-project:spring-boot-mail"))
3738
optional(project(":spring-boot-project:spring-boot-neo4j"))

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/ldap/LdapHealthContributorAutoConfiguration.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
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.ldap.LdapAutoConfiguration;
3029
import org.springframework.context.annotation.Bean;
3130
import org.springframework.ldap.core.LdapOperations;
3231

@@ -37,7 +36,7 @@
3736
* @author Stephane Nicoll
3837
* @since 2.0.0
3938
*/
40-
@AutoConfiguration(after = LdapAutoConfiguration.class)
39+
@AutoConfiguration(afterName = "org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration")
4140
@ConditionalOnClass(LdapOperations.class)
4241
@ConditionalOnBean(LdapOperations.class)
4342
@ConditionalOnEnabledHealthIndicator("ldap")

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

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ dependencies {
5252
optional(project(":spring-boot-project:spring-boot-jackson"))
5353
optional(project(":spring-boot-project:spring-boot-jdbc"))
5454
optional(project(":spring-boot-project:spring-boot-jsonb"))
55+
optional(project(":spring-boot-project:spring-boot-ldap"))
5556
optional(project(":spring-boot-project:spring-boot-liquibase"))
5657
optional(project(":spring-boot-project:spring-boot-neo4j"))
5758
optional(project(":spring-boot-project:spring-boot-r2dbc"))

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

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfigurati
4747
org.springframework.boot.autoconfigure.http.client.HttpClientAutoConfiguration
4848
org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration
4949
org.springframework.boot.autoconfigure.jersey.JerseyAutoConfiguration
50-
org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
51-
org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration
5250
org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration
5351
org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration
5452
org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration

spring-boot-project/spring-boot-autoconfigure-all/src/test/java/org/springframework/boot/autoconfigure/data/ldap/LdapRepositoriesAutoConfigurationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,7 +25,7 @@
2525
import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage;
2626
import org.springframework.boot.autoconfigure.data.ldap.person.Person;
2727
import org.springframework.boot.autoconfigure.data.ldap.person.PersonRepository;
28-
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
28+
import org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration;
2929
import org.springframework.boot.test.util.TestPropertyValues;
3030
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3131
import org.springframework.context.annotation.Configuration;

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

+1
Original file line numberDiff line numberDiff line change
@@ -2049,6 +2049,7 @@ bom {
20492049
"spring-boot-jpa",
20502050
"spring-boot-jsonb",
20512051
"spring-boot-kafka",
2052+
"spring-boot-ldap",
20522053
"spring-boot-liquibase",
20532054
"spring-boot-loader",
20542055
"spring-boot-loader-classic",

spring-boot-project/spring-boot-docker-compose/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ dependencies {
4444
optional(project(":spring-boot-project:spring-boot-flyway"))
4545
optional(project(":spring-boot-project:spring-boot-hazelcast"))
4646
optional(project(":spring-boot-project:spring-boot-jdbc"))
47+
optional(project(":spring-boot-project:spring-boot-ldap"))
4748
optional(project(":spring-boot-project:spring-boot-liquibase"))
4849
optional(project(":spring-boot-project:spring-boot-neo4j"))
4950
optional(project(":spring-boot-project:spring-boot-pulsar"))

spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/ldap/LLdapDockerComposeConnectionDetailsFactoryIntegrationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.boot.docker.compose.service.connection.ldap;
1818

19-
import org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails;
2019
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest;
20+
import org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails;
2121
import org.springframework.boot.testsupport.container.TestImage;
2222

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

spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/ldap/OpenLdapDockerComposeConnectionDetailsFactoryIntegrationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.boot.docker.compose.service.connection.ldap;
1818

19-
import org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails;
2019
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest;
20+
import org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails;
2121
import org.springframework.boot.testsupport.container.TestImage;
2222

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

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ldap/LLdapDockerComposeConnectionDetailsFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
import java.util.Map;
2020

21-
import org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails;
2221
import org.springframework.boot.docker.compose.core.RunningService;
2322
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory;
2423
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource;
24+
import org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails;
2525

2626
/**
2727
* {@link DockerComposeConnectionDetailsFactory} to create {@link LdapConnectionDetails}

spring-boot-project/spring-boot-docker-compose/src/main/java/org/springframework/boot/docker/compose/service/connection/ldap/OpenLdapDockerComposeConnectionDetailsFactory.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,10 +20,10 @@
2020
import java.util.Map;
2121
import java.util.stream.Collectors;
2222

23-
import org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails;
2423
import org.springframework.boot.docker.compose.core.RunningService;
2524
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionDetailsFactory;
2625
import org.springframework.boot.docker.compose.service.connection.DockerComposeConnectionSource;
26+
import org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails;
2727

2828
/**
2929
* {@link DockerComposeConnectionDetailsFactory} to create {@link LdapConnectionDetails}

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

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ dependencies {
7474
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jpa", configuration: "autoConfigurationMetadata"))
7575
autoConfiguration(project(path: ":spring-boot-project:spring-boot-jsonb", configuration: "autoConfigurationMetadata"))
7676
autoConfiguration(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "autoConfigurationMetadata"))
77+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-ldap", configuration: "autoConfigurationMetadata"))
7778
autoConfiguration(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "autoConfigurationMetadata"))
7879
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mail", configuration: "autoConfigurationMetadata"))
7980
autoConfiguration(project(path: ":spring-boot-project:spring-boot-mustache", configuration: "autoConfigurationMetadata"))
@@ -115,6 +116,7 @@ dependencies {
115116
configurationProperties(project(path: ":spring-boot-project:spring-boot-jetty", configuration: "configurationPropertiesMetadata"))
116117
configurationProperties(project(path: ":spring-boot-project:spring-boot-jms", configuration: "configurationPropertiesMetadata"))
117118
configurationProperties(project(path: ":spring-boot-project:spring-boot-kafka", configuration: "configurationPropertiesMetadata"))
119+
configurationProperties(project(path: ":spring-boot-project:spring-boot-ldap", configuration: "configurationPropertiesMetadata"))
118120
configurationProperties(project(path: ":spring-boot-project:spring-boot-liquibase", configuration: "configurationPropertiesMetadata"))
119121
configurationProperties(project(path: ":spring-boot-project:spring-boot-mail", configuration: "configurationPropertiesMetadata"))
120122
configurationProperties(project(path: ":spring-boot-project:spring-boot-mustache", configuration: "configurationPropertiesMetadata"))
@@ -145,6 +147,7 @@ dependencies {
145147
implementation(project(path: ":spring-boot-project:spring-boot-jpa"))
146148
implementation(project(path: ":spring-boot-project:spring-boot-jms"))
147149
implementation(project(path: ":spring-boot-project:spring-boot-jsonb"))
150+
implementation(project(path: ":spring-boot-project:spring-boot-ldap"))
148151
implementation(project(path: ":spring-boot-project:spring-boot-reactor-netty"))
149152
implementation(project(path: ":spring-boot-project:spring-boot-r2dbc"))
150153
implementation(project(path: ":spring-boot-project:spring-boot-test"))

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/features/dev-services.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ The following service connections are currently supported:
101101
| javadoc:org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails[]
102102
| Containers named "clickhouse/clickhouse-server", "bitnami/clickhouse", "gvenzl/oracle-free", "gvenzl/oracle-xe", "mariadb", "bitnami/mariadb", "mssql/server", "mysql", "bitnami/mysql", "postgres", or "bitnami/postgresql"
103103

104-
| javadoc:org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails[]
104+
| javadoc:org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails[]
105105
| Containers named "osixia/openldap", "lldap/lldap"
106106

107107
| javadoc:org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails[]

spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/testing/testcontainers.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The following service connection factories are provided in the `spring-boot-test
6262
| javadoc:org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails[]
6363
| Containers of type javadoc:org.testcontainers.kafka.KafkaContainer[], javadoc:org.testcontainers.kafka.ConfluentKafkaContainer[] or javadoc:org.testcontainers.redpanda.RedpandaContainer[]
6464

65-
| javadoc:org.springframework.boot.autoconfigure.ldap.LdapConnectionDetails[]
65+
| javadoc:org.springframework.boot.ldap.autoconfigure.LdapConnectionDetails[]
6666
| Containers named "osixia/openldap" or of type javadoc:org.testcontainers.ldap.LLdapContainer[]
6767

6868
| javadoc:org.springframework.boot.autoconfigure.liquibase.LiquibaseConnectionDetails[]

spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringdataldap/server/MyDataLdapTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringdataldap.server;
1818

19-
import org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration;
19+
import org.springframework.boot.ldap.autoconfigure.embedded.EmbeddedLdapAutoConfiguration;
2020
import org.springframework.boot.test.autoconfigure.data.ldap.DataLdapTest;
2121

2222
@DataLdapTest(excludeAutoConfiguration = EmbeddedLdapAutoConfiguration.class)

spring-boot-project/spring-boot-docs/src/main/kotlin/org/springframework/boot/docs/testing/springbootapplications/autoconfiguredspringdataldap/server/MyDataLdapTests.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
package org.springframework.boot.docs.testing.springbootapplications.autoconfiguredspringdataldap.server
1818

19-
import org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration
19+
import org.springframework.boot.ldap.autoconfigure.embedded.EmbeddedLdapAutoConfiguration
2020
import org.springframework.boot.test.autoconfigure.data.ldap.DataLdapTest
2121

2222
@DataLdapTest(excludeAutoConfiguration = [EmbeddedLdapAutoConfiguration::class])
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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.deployed"
6+
id "org.springframework.boot.optional-dependencies"
7+
}
8+
9+
description = "Spring Boot LDAP"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot"))
13+
api("org.springframework.ldap:spring-ldap-core")
14+
15+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
16+
optional("com.unboundid:unboundid-ldapsdk")
17+
18+
testImplementation(project(":spring-boot-project:spring-boot-test"))
19+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
20+
21+
testRuntimeOnly("ch.qos.logback:logback-classic")
22+
testRuntimeOnly("org.apache.commons:commons-pool2")
23+
}
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.ldap;
17+
package org.springframework.boot.ldap.autoconfigure;
1818

1919
import java.util.Collections;
2020

@@ -23,10 +23,10 @@
2323
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2424
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
2525
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
26-
import org.springframework.boot.autoconfigure.ldap.LdapProperties.Template;
2726
import org.springframework.boot.context.properties.EnableConfigurationProperties;
2827
import org.springframework.boot.context.properties.PropertyMapper;
2928
import org.springframework.boot.convert.ApplicationConversionService;
29+
import org.springframework.boot.ldap.autoconfigure.LdapProperties.Template;
3030
import org.springframework.context.annotation.Bean;
3131
import org.springframework.core.env.Environment;
3232
import org.springframework.ldap.convert.ConverterUtils;
@@ -43,7 +43,7 @@
4343
*
4444
* @author Eddú Meléndez
4545
* @author Vedran Pavic
46-
* @since 1.5.0
46+
* @since 4.0.0
4747
*/
4848
@AutoConfiguration
4949
@ConditionalOnClass(ContextSource.class)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,15 +14,15 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.ldap;
17+
package org.springframework.boot.ldap.autoconfigure;
1818

1919
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
2020

2121
/**
2222
* Details required to establish a connection to an LDAP service.
2323
*
2424
* @author Philipp Kessler
25-
* @since 3.3.0
25+
* @since 4.0.0
2626
*/
2727
public interface LdapConnectionDetails extends ConnectionDetails {
2828

Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.ldap;
17+
package org.springframework.boot.ldap.autoconfigure;
1818

1919
import java.util.HashMap;
2020
import java.util.Map;
@@ -29,7 +29,7 @@
2929
* Configuration properties for LDAP.
3030
*
3131
* @author Eddú Meléndez
32-
* @since 1.5.0
32+
* @since 4.0.0
3333
*/
3434
@ConfigurationProperties("spring.ldap")
3535
public class LdapProperties {
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.ldap;
17+
package org.springframework.boot.ldap.autoconfigure;
1818

1919
import org.springframework.core.env.Environment;
2020

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.ldap.embedded;
17+
package org.springframework.boot.ldap.autoconfigure.embedded;
1818

1919
import java.io.InputStream;
2020
import java.util.Collections;
@@ -28,10 +28,10 @@
2828
import com.unboundid.ldap.sdk.LDAPException;
2929
import com.unboundid.ldap.sdk.schema.Schema;
3030
import com.unboundid.ldif.LDIFReader;
31-
import jakarta.annotation.PreDestroy;
3231

3332
import org.springframework.aot.hint.RuntimeHints;
3433
import org.springframework.aot.hint.RuntimeHintsRegistrar;
34+
import org.springframework.beans.factory.DisposableBean;
3535
import org.springframework.boot.autoconfigure.AutoConfiguration;
3636
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
3737
import org.springframework.boot.autoconfigure.condition.ConditionMessage;
@@ -40,12 +40,12 @@
4040
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
4141
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
4242
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
43-
import org.springframework.boot.autoconfigure.ldap.LdapAutoConfiguration;
44-
import org.springframework.boot.autoconfigure.ldap.LdapProperties;
45-
import org.springframework.boot.autoconfigure.ldap.embedded.EmbeddedLdapAutoConfiguration.EmbeddedLdapAutoConfigurationRuntimeHints;
4643
import org.springframework.boot.context.properties.EnableConfigurationProperties;
4744
import org.springframework.boot.context.properties.bind.Bindable;
4845
import org.springframework.boot.context.properties.bind.Binder;
46+
import org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration;
47+
import org.springframework.boot.ldap.autoconfigure.LdapProperties;
48+
import org.springframework.boot.ldap.autoconfigure.embedded.EmbeddedLdapAutoConfiguration.EmbeddedLdapAutoConfigurationRuntimeHints;
4949
import org.springframework.context.ApplicationContext;
5050
import org.springframework.context.ConfigurableApplicationContext;
5151
import org.springframework.context.annotation.Bean;
@@ -70,14 +70,14 @@
7070
* @author Eddú Meléndez
7171
* @author Mathieu Ouellet
7272
* @author Raja Kolli
73-
* @since 1.5.0
73+
* @since 4.0.0
7474
*/
7575
@AutoConfiguration(before = LdapAutoConfiguration.class)
7676
@EnableConfigurationProperties({ LdapProperties.class, EmbeddedLdapProperties.class })
7777
@ConditionalOnClass(InMemoryDirectoryServer.class)
7878
@Conditional(EmbeddedLdapAutoConfiguration.EmbeddedLdapCondition.class)
7979
@ImportRuntimeHints(EmbeddedLdapAutoConfigurationRuntimeHints.class)
80-
public class EmbeddedLdapAutoConfiguration {
80+
public class EmbeddedLdapAutoConfiguration implements DisposableBean {
8181

8282
private static final String PROPERTY_SOURCE_NAME = "ldap.ports";
8383

@@ -167,8 +167,8 @@ private Map<String, Object> getLdapPorts(MutablePropertySources sources) {
167167
return (Map<String, Object>) propertySource.getSource();
168168
}
169169

170-
@PreDestroy
171-
public void close() {
170+
@Override
171+
public void destroy() throws Exception {
172172
if (this.server != null) {
173173
this.server.shutDown(true);
174174
}

0 commit comments

Comments
 (0)