Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[MCOMPILER-461] Compile fails when class references a class generated by an annotation processor and module-info.java is present

Open
#679 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
build-system

Research direction

Reproduce the failure by checking out logging-log4j2 at module-compile-fails and running mvn clean install. Inspect log4j-core/src/main/java/org/apache/logging/log4j/core/osgi/Activator.java, module-info.java, and the annotation-processor-generated Log4jPlugins reference, then compare Maven's compile command with direct javac as described. Done means isolating why Maven fails to resolve the generated class and verifying the module build succeeds.

Written by the indexing model from the issue text.

Description

bug priority:major

Ralph Goers opened MCOMPILER-461 and commented

While trying to convert Log4j-core to a JPMS module I have run into an issue where I have a class that references a class that is generated by Log4j's annotation processor and that class gets an error saying the referenced class cannot be found. However, after the compile fails I can see that the file was generated.

To reproduce:
git clone https://github.com/apache/logging-log4j2.git
cd logging-log4j2
git checkout module-compile-fails
mvn clean install

The compile will fail in log4j-core. Some appear to be errors in javac for which I have opened an issue with openjdk. But if I do "mvn -X clean install" and copy the compile command line and prepend it with javac when it runs I no longer see

[ERROR] /Users/rgoers/projects/apache/logging/log4j/logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/osgi/Activator.java:[29,44] error: cannot find symbol symbol: class Log4jPlugins location: package org.apache.logging.log4j.core.plugins

which indicates that Maven is somehow causing that.


Affects: 3.8.1

Attachments:

1 votes, 2 watchers

Dominant language
Java
Stars
261
Forks
194
Avg merge
1d 5h
Merged PRs (30d)
17

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/maven-compiler-plugin

All issues in apache/maven-compiler-plugin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.