apache / apache/maven-compiler-plugin

[MCOMPILER-271] APT generated classes not visible during test compilation

Open
#351 9 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

**[Oliver Drotbohm](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=oliver.gierke)** opened **[MCOMPILER-271](https://issues.apache.org/jira/browse/MCOMPILER-271?redirect=false)** and commented

After upgrading the Maven Compiler Plugin to 3.5.1, I see compilation errors with builds that work on 3.5. The symptom is that classes generated by an APT plugin are not visible on the test class path when `target/generated-sources/annotations` is used as output folder.

I'll attach a sample project that shows the failure if you run `mvn clean test-compile`.

Two things make the project work:

1. Downgrade to 3.5 (which makes me think any of the fixes made for MCOMPILER-240 has to do with this).
2. Change `annotations` segment of the output path to something other than `annotations`.

Especially the latter puzzles me as it seems like this path is explicitly not added to the test compile classpath.

---

**Affects:** 3.5.1, 3.6.1

**Attachments:**
- [compiler-plugin-bug.zip](https://issues.apache.org/jira/secure/attachment/12816300/compiler-plugin-bug.zip) (_5.98 kB_)

0 votes, 9 watchers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the attached compiler-plugin-bug.zip sample project and run `mvn clean test-compile` using Maven Compiler Plugin 3.5.1. Compare the behavior with 3.5 and inspect how `target/generated-sources/annotations` is handled on the test compile classpath. Done means generated APT classes are visible during test compilation without renaming the `annotations` path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.