You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2024/11/28 16:49:16 UTC
[I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
ppkarwasz opened a new issue, #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251
Currently `log4j-plugin-processor` in version `3.0.0-beta3` of Log4j Core adds [BND annotations](https://bnd.bndtools.org/chapters/230-manifest-annotations.html) 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.
--
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: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
Posted by "lockhartja (via GitHub)" <gi...@apache.org>.
lockhartja commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2597037213
@ppkarwasz to clarify my use case -- I was attempting to build a a custom plug however the annotation processor (using Kotlin Kapt) breaks -- complaining that the annotations are unable to be resolved.
```
error: cannot find symbol
@ServiceProvider(value = PluginService.class, resolution = Resolution.OPTIONAL)
^
symbol: variable Resolution
error: package aQute.bnd.annotation.spi does not exist
import aQute.bnd.annotation.spi.ServiceProvider;
error: cannot find symbol
@ServiceProvider(value = PluginService.class, resolution = Resolution.OPTIONAL)
^
symbol: class ServiceProvider
```
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2596854193
`biz.aQute.bnd.annotation` has a retention of `CLASS`, i.e. its presence or absence does not make a difference at runtime.
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2506508805
A workaround for this issue is to add:
```xml
<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:
```java
requires static biz.aQute.bnd.annotation;
```
to the module descriptor. The annotations have a `CLASS` retention, so they don't cause problems at runtime.
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2598287903
@lockhartja,
Did you try adding:
```groovy
compileOnly 'biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0'
```
to you dependencies?
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS (logging-log4j2)
Posted by "lockhartja (via GitHub)" <gi...@apache.org>.
lockhartja commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2596842243
> 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.
Just wanted to confirm -- the suggested workaround code changes on the source -- not during usage, correct? Meaning... wait until beta4 to use the PlugProcessor in non-OSGi environments
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Generate `Log4jPlugins` class does not compile in JPMS [logging-log4j2]
Posted by "Stefman87 (via GitHub)" <gi...@apache.org>.
Stefman87 commented on issue #3251:
URL: https://github.com/apache/logging-log4j2/issues/3251#issuecomment-2677099002
@ppkarwasz Maybe it is better to change milestone to `3.x`?
--
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: notifications-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org