apache / apache/maven-compiler-plugin

[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
bug priority:major
Dominant language
Java
Stars
261
Forks
191
Avg merge
1d 5h
Merged PRs (30d)
8

Description

**[Ralph Goers](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=ralph.goers@dslextreme.com)** opened **[MCOMPILER-461](https://issues.apache.org/jira/browse/MCOMPILER-461?redirect=false)** 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:**
- [mvn.txt](https://issues.apache.org/jira/secure/attachment/13024226/mvn.txt) (_41.96 kB_)
- [wtf](https://issues.apache.org/jira/secure/attachment/13030445/wtf) (_30.04 kB_)

1 votes, 2 watchers

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.