You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
One could argue that this is more a problem of the plugin than of Spring LDAP. On the other hand, there is in my opinion real value in adhering to the conventions of the Java ecosystem to leverage all available tools. And by now, these conventions seems to actually include the requirements of JPMS.
Thanks for the report, @hpoettker. Because ldif-core is dependent on core, it seems fine to move them into core. I prefer moving them to changing the package since a package change would need to wait for the 3.x line.
The package
org.springframework.ldap.core
is a split package as it contains (different) classes in the artifactsspring-ldap-core
andspring-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 with2.4.0-M2
have it set. But I'm afraid, the classesLdapAttribute
andLdapAttributes
need to be moved either to the core module or to a different package to allowspring-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 usesorg.springframework.ldap.core.LdapAttribute
fromspring-ldap-ldif-core
just to say Hello. If the transitive dependency tospring-ldap-core
is excluded, this works fine. Otherwise, the app won't compile and the Gradle compile task logs:The reproducer uses Java 17 and Gradle 7.4.
The text was updated successfully, but these errors were encountered: