Skip to content
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

Generate Log4jPlugins class does not compile in JPMS #3251

Open
ppkarwasz opened this issue Nov 28, 2024 · 1 comment
Open

Generate Log4jPlugins class does not compile in JPMS #3251

ppkarwasz opened this issue Nov 28, 2024 · 1 comment
Milestone

Comments

@ppkarwasz
Copy link
Contributor

Currently log4j-plugin-processor in version 3.0.0-beta3 of Log4j Core adds BND annotations to the generated code.

While these might be useful for OSGi users, they cause a compilation error if the biz.aQute.bnd.annotation module is not present:

  • On the compiler classpath,
  • A static dependency on the module is not declared in the module-info.java file.
@ppkarwasz
Copy link
Contributor Author

A workaround for this issue is to add:

<dependency>
  <groupId>biz.aQute.bnd</groupId>
  <artifactId>biz.aQute.bnd.annotation</artifactId>
  <version>7.1.0</version>
  <scope>provided</scope>
</dependency>

to the compile-time only classpath and a:

requires static biz.aQute.bnd.annotation;

to the module descriptor. The annotations have a CLASS retention, so they don't cause problems at runtime.

@ppkarwasz ppkarwasz added this to the 3.0.0-beta4 milestone Nov 28, 2024
ppkarwasz added a commit that referenced this issue Nov 30, 2024
This adds a `log4j.plugin.enableBndAnnotations` option to the `PluginProcessor`. Its default value is inferred from the compiler classpath.

We also rename the `pluginPackage` option to a more coherent `log4j.plugin.package` option.

Closes #3251
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

No branches or pull requests

1 participant