Skip to content

The package org.springframework.ldap.core is split #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hpoettker opened this issue Apr 3, 2022 · 2 comments
Closed

The package org.springframework.ldap.core is split #632

hpoettker opened this issue Apr 3, 2022 · 2 comments

Comments

@hpoettker
Copy link

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.

@hpoettker
Copy link
Author

Just for completeness: I stumbled on this problem not while actually trying to build a modular application.

I was rather trying to build javadocs from a Maven build for a project that has itself the Automatic-Module-Name set. I was then hit by this: https://issues.apache.org/jira/browse/MJAVADOC-707

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.

@jzheaux jzheaux self-assigned this May 5, 2022
@jzheaux jzheaux added this to the 2.4.0 milestone May 5, 2022
@jzheaux
Copy link
Collaborator

jzheaux commented May 5, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants