-
Notifications
You must be signed in to change notification settings - Fork 487
Description
The package org.springframework.ldap.core is a split package as it contains (different) classes in the artifacts spring-ldap-core and spring-ldap-ldif-core, respectively.
Starting with the commit d752db8, the Automatic-Module-Name is set in the produced jars. And the jars that have been released with 2.4.0-M2 have it set. But I'm afraid, the classes LdapAttribute and LdapAttributes need to be moved either to the core module or to a different package to allow spring-ldap-ldif-core to be used in a modularized application. Users have the possibility to e.g. repackage the two jars into one in their builds, but it would be great if that were not necessary.
I've built a trivial reproducer: https://github.com/hpoettker/modular-spring-ldap
It's the Gradle init app with a module-info.java that uses org.springframework.ldap.core.LdapAttribute from spring-ldap-ldif-core just to say Hello. If the transitive dependency to spring-ldap-core is excluded, this works fine. Otherwise, the app won't compile and the Gradle compile task logs:
error: the unnamed module reads package org.springframework.ldap.core from both spring.ldap.core and spring.ldap.ldif.core
error: module spring.tx reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
error: module spring.beans reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
error: module spring.core reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
error: module spring.jcl reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
error: module spring.ldap.core reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
error: module spring.ldap.ldif.core reads package org.springframework.ldap.core from both spring.ldap.core and spring.ldap.ldif.core
/home/hpoettker/modular-spring-ldap/app/src/main/java/module-info.java:1: error: module com.github.hpoettker reads package org.springframework.ldap.core from both spring.ldap.ldif.core and spring.ldap.core
The reproducer uses Java 17 and Gradle 7.4.