Skip to content

Export the non-internal packages in OSGi and JPMS - #532

Merged
ppkarwasz merged 1 commit into
trunkfrom
feat/export-packages
Nov 9, 2026
Merged

ppkarwasz merged 1 commit into
trunkfrom
feat/export-packages

Conversation

@ppkarwasz

Copy link
Copy Markdown
Member

logging-parent only exports packages annotated with @Export. Since no Flume package had that annotation, every Flume JAR had an empty exports list in module-info.class and no Export-Package header, so the modules could not be used on the module path or in OSGi containers. For example, on the module path EnvironmentVariableConfigFilter fails with:

java.lang.IllegalAccessError: superclass access check failed: class org.apache.flume.configfilter.env.EnvironmentVariableConfigFilter
(in module org.apache.flume.flume.environment.variable.config.filter) cannot access class org.apache.flume.configfilter.AbstractConfigFilter
(in module org.apache.flume.flume.config.filter.api) because module org.apache.flume.flume.config.filter.api does not export org.apache.flume.configfilter

This PR:

  • Adds a package-info.java with @Export and @Version("2.0.0") to every non-internal package (41 packages in 17 modules).
  • Manages org.osgi.annotation.bundle and org.osgi.annotation.versioning in flume-parent with provided scope, and declares them in each module.

The following packages are not exported:

  • org.apache.flume.conf.internal and org.apache.flume.node.internal: internal by design. conf.internal is also used by flume-file-channel and flume-node, but it only contains the SuppressFBWarnings annotation, so there is no runtime reference.
  • org.apache.flume.source.shaded.guava: vendored Guava code, used only by StressSource.
  • org.apache.flume.channel.file.proto: generated Protobuf classes of the file channel's on-disk format.

Classpath usage, which bin/flume-ng relies on, is unaffected.

🤖 Generated with Claude Code

logging-parent only exports packages annotated with `@Export`, so no Flume package was exported and the modules could not be used on the module path or in OSGi containers.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@ppkarwasz
ppkarwasz enabled auto-merge (squash) November 9, 2026 21:07
@ppkarwasz
ppkarwasz merged commit 3074313 into trunk Nov 9, 2026
12 checks passed
@ppkarwasz
ppkarwasz deleted the feat/export-packages branch November 9, 2026 21:28
ppkarwasz added a commit that referenced this pull request Nov 9, 2026
The exported component packages reference it, so bnd rejects the build since #528 and #532 were both merged.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
ppkarwasz added a commit that referenced this pull request Nov 9, 2026
…529)

* Register the components of the other modules through `ServiceLoader`

Each module now registers its own `type` aliases, so `flume-core` no longer needs to know their class names.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>

* Export the `org.apache.flume.spi` package

The exported component packages reference it, so bnd rejects the build since #528 and #532 were both merged.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant