ramanathan1504 commented on issue #3161:
URL:
https://github.com/apache/logging-log4j2/issues/3161#issuecomment-3297182983
Hi @jvz, thanks for your work on this.
I've merged the latest changes from the target branch, including #3681 and
#3199, and I'm now encountering a build failure in the `log4j-kit` module.
The OSGi `bnd-maven-plugin` is failing during its processing step with the
following errors:
```
[ERROR]
/Users/ramanathan/Contributor/logging-log4j2/log4j-kit/.flattened-pom.xml
[0:0]: Export org.apache.logging.log4j.kit.logger, has 1, private references
[org.apache.logging.log4j.kit.recycler]
[ERROR]
/Users/ramanathan/Contributor/logging-log4j2/log4j-kit/.flattened-pom.xml
[0:0]: Export org.apache.logging.log4j.kit.recycler.support, has 1, private
references [org.apache.logging.log4j.kit.recycler]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal
biz.aQute.bnd:bnd-maven-plugin:7.1.0:bnd-process (generate-module-descriptors)
on project log4j-kit: Errors in bnd processing, see log for details.
```
The issue is that two exported packages
(`org.apache.logging.log4j.kit.logger` and
`org.apache.logging.log4j.kit.recycler.support`) have public APIs that expose
types from `org.apache.logging.log4j.kit.recycler`, which is currently not an
exported (i.e., private) package. This violates module encapsulation rules.
To resolve this, I see two possible approaches:
* **Option 1: Promote `org.apache.logging.log4j.kit.recycler` to a Public
Package.**
We can add this package to the `<Export-Package>` instruction in the
`pom.xml`. This would make it an official part of the `log4j-kit` public API.
* **Option 2: Keep `org.apache.logging.log4j.kit.recycler` as an Internal
Package.**
This would maintain stricter encapsulation. To fix the build, we would
need to refactor the public APIs in the `logger` and `recycler.support`
packages to avoid exposing types from `recycler`. This is often the preferred
approach for internal utility packages.
Could you please provide guidance on which approach aligns better with the
project's design goals? Is `recycler` intended to be a public utility, or
should it remain an internal implementation detail?
Alternatively, if this has already been fixed in a different PR I might have
missed, please let me know.
Once I have your feedback, I am happy to update the PR accordingly.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]