Skip to content

Commit c6926a8

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

File tree

19 files changed

+60
-39
lines changed

19 files changed

+60
-39
lines changed

settings.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ include "spring-boot-project:spring-boot-batch"
5353
include "spring-boot-project:spring-boot-cassandra"
5454
include "spring-boot-project:spring-boot-couchbase"
5555
include "spring-boot-project:spring-boot-data-jpa"
56+
include "spring-boot-project:spring-boot-data-ldap"
5657
include "spring-boot-project:spring-boot-dependencies"
5758
include "spring-boot-project:spring-boot-devtools"
5859
include "spring-boot-project:spring-boot-docker-compose"

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

-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ 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"))
5655
optional(project(":spring-boot-project:spring-boot-liquibase"))
5756
optional(project(":spring-boot-project:spring-boot-neo4j"))
5857
optional(project(":spring-boot-project:spring-boot-r2dbc"))
@@ -113,7 +112,6 @@ dependencies {
113112
optional("com.sendgrid:sendgrid-java") {
114113
exclude group: "commons-logging", module: "commons-logging"
115114
}
116-
optional("com.unboundid:unboundid-ldapsdk")
117115
optional("com.zaxxer:HikariCP")
118116
optional("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect")
119117
optional("org.aspectj:aspectjweaver")
@@ -185,7 +183,6 @@ dependencies {
185183
exclude group: "org.elasticsearch.client", module: "transport"
186184
}
187185
optional("org.springframework.data:spring-data-jdbc")
188-
optional("org.springframework.data:spring-data-ldap")
189186
optional("org.springframework.data:spring-data-mongodb")
190187
optional("org.springframework.data:spring-data-neo4j")
191188
optional("org.springframework.data:spring-data-r2dbc")

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

-6
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,6 @@
326326
"description": "Whether to enable JDBC repositories.",
327327
"defaultValue": true
328328
},
329-
{
330-
"name": "spring.data.ldap.repositories.enabled",
331-
"type": "java.lang.Boolean",
332-
"description": "Whether to enable LDAP repositories.",
333-
"defaultValue": true
334-
},
335329
{
336330
"name": "spring.data.mongodb.grid-fs-database",
337331
"type": "java.lang.String",

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

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoC
1313
org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchRepositoriesAutoConfiguration
1414
org.springframework.boot.autoconfigure.data.elasticsearch.ReactiveElasticsearchRepositoriesAutoConfiguration
1515
org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration
16-
org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration
1716
org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration
1817
org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration
1918
org.springframework.boot.autoconfigure.data.mongo.MongoReactiveRepositoriesAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 Data LDAP"
10+
11+
dependencies {
12+
api(project(":spring-boot-project:spring-boot-ldap"))
13+
api("org.springframework.data:spring-data-ldap")
14+
15+
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
16+
17+
testImplementation(project(":spring-boot-project:spring-boot-test"))
18+
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
19+
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-autoconfigure")))
20+
21+
testRuntimeOnly("ch.qos.logback:logback-classic")
22+
}
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.data.ldap;
17+
package org.springframework.boot.data.ldap.autoconfigure;
1818

1919
import javax.naming.ldap.LdapContext;
2020

@@ -31,7 +31,7 @@
3131
* {@link EnableAutoConfiguration Auto-configuration} for Spring Data's LDAP Repositories.
3232
*
3333
* @author Eddú Meléndez
34-
* @since 1.5.0
34+
* @since 4.0.0
3535
*/
3636
@AutoConfiguration
3737
@ConditionalOnClass({ LdapContext.class, LdapRepository.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,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

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

1919
import java.lang.annotation.Annotation;
2020

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.
@@ -17,4 +17,4 @@
1717
/**
1818
* Auto-configuration for Spring Data LDAP.
1919
*/
20-
package org.springframework.boot.autoconfigure.data.ldap;
20+
package org.springframework.boot.data.ldap.autoconfigure;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"groups": [],
3+
"properties": [
4+
{
5+
"name": "spring.data.ldap.repositories.enabled",
6+
"type": "java.lang.Boolean",
7+
"description": "Whether to enable LDAP repositories.",
8+
"defaultValue": true
9+
}
10+
]
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.springframework.boot.data.ldap.autoconfigure.LdapRepositoriesAutoConfiguration
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
* limitations under the License.
1515
*/
1616

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

1919
import org.junit.jupiter.api.AfterEach;
2020
import org.junit.jupiter.api.Test;
2121

2222
import org.springframework.boot.autoconfigure.TestAutoConfigurationPackage;
2323
import org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration;
24-
import org.springframework.boot.autoconfigure.data.alt.ldap.PersonLdapRepository;
25-
import org.springframework.boot.autoconfigure.data.empty.EmptyDataPackage;
26-
import org.springframework.boot.autoconfigure.data.ldap.person.Person;
27-
import org.springframework.boot.autoconfigure.data.ldap.person.PersonRepository;
24+
import org.springframework.boot.data.ldap.autoconfigure.domain.empty.EmptyDataPackage;
25+
import org.springframework.boot.data.ldap.autoconfigure.domain.person.Person;
26+
import org.springframework.boot.data.ldap.autoconfigure.domain.person.PersonRepository;
2827
import org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration;
2928
import org.springframework.boot.test.util.TestPropertyValues;
3029
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -64,7 +63,7 @@ void testNoRepositoryConfiguration() {
6463
@Test
6564
void doesNotTriggerDefaultRepositoryDetectionIfCustomized() {
6665
load(CustomizedConfiguration.class);
67-
assertThat(this.context.getBean(PersonLdapRepository.class)).isNotNull();
66+
assertThat(this.context.getBean(PersonRepository.class)).isNotNull();
6867
}
6968

7069
private void load(Class<?>... configurationClasses) {
@@ -90,7 +89,7 @@ static class EmptyConfiguration {
9089

9190
@Configuration(proxyBeanMethods = false)
9291
@TestAutoConfigurationPackage(LdapRepositoriesAutoConfigurationTests.class)
93-
@EnableLdapRepositories(basePackageClasses = PersonLdapRepository.class)
92+
@EnableLdapRepositories(basePackageClasses = PersonRepository.class)
9493
static class CustomizedConfiguration {
9594

9695
}
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.
@@ -14,13 +14,8 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.autoconfigure.data.alt.ldap;
17+
package org.springframework.boot.data.ldap.autoconfigure.domain.empty;
1818

19-
import javax.naming.Name;
20-
21-
import org.springframework.boot.autoconfigure.data.ldap.person.Person;
22-
import org.springframework.data.repository.Repository;
23-
24-
public interface PersonLdapRepository extends Repository<Person, Name> {
19+
public class EmptyDataPackage {
2520

2621
}
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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

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

1919
import javax.naming.Name;
2020

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.
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

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

1919
import javax.naming.Name;
2020

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

+1
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,7 @@ bom {
20322032
"spring-boot-configuration-processor",
20332033
"spring-boot-couchbase",
20342034
"spring-boot-data-jpa",
2035+
"spring-boot-data-ldap",
20352036
"spring-boot-devtools",
20362037
"spring-boot-docker-compose",
20372038
"spring-boot-elasticsearch",

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

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dependencies {
6060
autoConfiguration(project(path: ":spring-boot-project:spring-boot-cassandra", configuration: "autoConfigurationMetadata"))
6161
autoConfiguration(project(path: ":spring-boot-project:spring-boot-couchbase", configuration: "autoConfigurationMetadata"))
6262
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-jpa", configuration: "autoConfigurationMetadata"))
63+
autoConfiguration(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "autoConfigurationMetadata"))
6364
autoConfiguration(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "autoConfigurationMetadata"))
6465
autoConfiguration(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "autoConfigurationMetadata"))
6566
autoConfiguration(project(path: ":spring-boot-project:spring-boot-flyway", configuration: "autoConfigurationMetadata"))
@@ -102,6 +103,7 @@ dependencies {
102103
configurationProperties(project(path: ":spring-boot-project:spring-boot-cassandra", configuration: "configurationPropertiesMetadata"))
103104
configurationProperties(project(path: ":spring-boot-project:spring-boot-couchbase", configuration: "configurationPropertiesMetadata"))
104105
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-jpa", configuration: "configurationPropertiesMetadata"))
106+
configurationProperties(project(path: ":spring-boot-project:spring-boot-data-ldap", configuration: "configurationPropertiesMetadata"))
105107
configurationProperties(project(path: ":spring-boot-project:spring-boot-devtools", configuration: "configurationPropertiesMetadata"))
106108
configurationProperties(project(path: ":spring-boot-project:spring-boot-docker-compose", configuration: "configurationPropertiesMetadata"))
107109
configurationProperties(project(path: ":spring-boot-project:spring-boot-elasticsearch", configuration: "configurationPropertiesMetadata"))

spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/build.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ description = "Starter for using Spring Data LDAP"
66

77
dependencies {
88
api(project(":spring-boot-project:spring-boot-starters:spring-boot-starter"))
9-
api(project(":spring-boot-project:spring-boot-ldap"))
9+
api(project(":spring-boot-project:spring-boot-data-ldap"))
1010
api(project(":spring-boot-project:spring-boot-tx"))
11-
api("org.springframework.data:spring-data-ldap")
1211
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ dependencies {
3939
optional(project(":spring-boot-project:spring-boot-cassandra"))
4040
optional(project(":spring-boot-project:spring-boot-couchbase"))
4141
optional(project(":spring-boot-project:spring-boot-data-jpa"))
42+
optional(project(":spring-boot-project:spring-boot-data-ldap"))
4243
optional(project(":spring-boot-project:spring-boot-elasticsearch"))
4344
optional(project(":spring-boot-project:spring-boot-flyway"))
4445
optional(project(":spring-boot-project:spring-boot-groovy-templates"))
4546
optional(project(":spring-boot-project:spring-boot-jackson"))
4647
optional(project(":spring-boot-project:spring-boot-jdbc"))
4748
optional(project(":spring-boot-project:spring-boot-jooq"))
4849
optional(project(":spring-boot-project:spring-boot-jsonb"))
49-
optional(project(":spring-boot-project:spring-boot-ldap"))
5050
optional(project(":spring-boot-project:spring-boot-liquibase")) {
5151
exclude(group: "org.liquibase")
5252
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# AutoConfigureDataLdap auto-configuration imports
2-
org.springframework.boot.autoconfigure.data.ldap.LdapRepositoriesAutoConfiguration
2+
org.springframework.boot.data.ldap.autoconfigure.LdapRepositoriesAutoConfiguration
33
org.springframework.boot.ldap.autoconfigure.LdapAutoConfiguration
44
org.springframework.boot.ldap.autoconfigure.embedded.EmbeddedLdapAutoConfiguration
55
optional:org.springframework.boot.testcontainers.service.connection.ServiceConnectionAutoConfiguration

0 commit comments

Comments
 (0)