fix: restore Log4j2Plugins.dat in apm-toolkit-log4j-2.x (#825)

### Problem

Since **9.5.0**, the released `apm-toolkit-log4j-2.x` jar no longer contains the Log4j2 plugin descriptor:

```
META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat
```

Without that descriptor Log4j2 cannot discover `TraceIdConverter`, so `%traceId` and `%sw_ctx` in a `PatternLayout` silently break — they are greedily matched as the built-in `%t` (thread name) followed by literal text.

Verified against Maven Central:

| Version | `Log4j2Plugins.dat` |
|---------|---------------------|
| 9.0.0 – 9.4.0 | present |
| 9.5.0 – 9.7.0 | **missing** |

### Root Cause

9.5.0 added an `annotationProcessorPaths` block to `maven-compiler-plugin` in the root `pom.xml`, listing only Lombok. Once `annotationProcessorPaths` is declared explicitly, javac stops discovering annotation processors from the compile classpath. The `log4j-core` jar is declared as `provided` in this module, and Log4j2's `PluginProcessor` — previously picked up from that classpath — is what generates `Log4j2Plugins.dat`. With the processor list narrowed to Lombok only, `PluginProcessor` never runs and the descriptor is silently dropped.

### Fix

Declare the compiler plugin in this module with `annotationProcessorPaths` containing both Lombok (preserving parent behaviour) and `log4j-core` (restoring the `PluginProcessor`).
2 files changed
tree: 01e8bf8e76b7dfd15b56eedc7d940b99c39ad032
  1. .claude/
  2. .github/
  3. .mvn/
  4. apm-application-toolkit/
  5. apm-checkstyle/
  6. apm-commons/
  7. apm-protocol/
  8. apm-sniffer/
  9. changes/
  10. dist-material/
  11. docs/
  12. test/
  13. tools/
  14. .asf.yaml
  15. .dlc.json
  16. .dockerignore
  17. .gitignore
  18. .gitmodules
  19. .licenserc.yaml
  20. CHANGES.md
  21. CLAUDE.md
  22. codeStyle.xml
  23. CONTRIBUTING.md
  24. Dockerfile
  25. HEADER
  26. LICENSE
  27. lombok.config
  28. Makefile
  29. mvnw
  30. mvnw.cmd
  31. NOTICE
  32. pom.xml
  33. README.md
README.md

Apache SkyWalking Java Agent

GitHub stars Twitter Follow

Maven Central CI

SkyWalking-Java: The Java Agent for Apache SkyWalking, which provides the native tracing/metrics/logging abilities for Java projects.

SkyWalking: an APM(application performance monitor) system, especially designed for microservices, cloud native and container-based (Docker and Kubernetes) architectures.

Documentation

Downloads

Please head to the releases page to download a release of Apache SkyWalking.

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please follow the REPORTING GUIDELINES to report unacceptable behavior.

Live Demo

Find the demo and screenshots on our website.

Contact Us

  • Mail list: dev@skywalking.apache.org. Mail to dev-subscribe@skywalking.apache.org, follow the reply to subscribe the mail list.
  • Send Request to join SkyWalking slack mail to the mail list(dev@skywalking.apache.org), we will invite you in.
  • For Chinese speaker, send [CN] Request to join SkyWalking slack mail to the mail list(dev@skywalking.apache.org), we will invite you in.
  • Twitter, ASFSkyWalking
  • bilibili B站 视频

License

Apache 2.0 License.