Skip to content

Add disabled IT for ECJ single-module -sourcepath bug - #550

Merged
slachiewicz merged 1 commit into
masterfrom
ecj-single-module-sourcepath-it
Nov 18, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
ecj-single-module-sourcepath-it

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Part of #548.

Adds ecj-single-module-sourcepath, an IT that compiles only module-info.java while the other two sources are found through the source roots that plexus-compiler passes to ECJ as -sourcepath. This reproduces upstream eclipse-jdt/eclipse.jdt.core#5759: the exported packages are reported as missing because ECJ puts sourcepath sources in the unnamed module.

The IT is excluded via <pomExcludes> in plexus-compiler-its/pom.xml, with a comment linking the upstream issue and #548. When ECJ ships a fix, enable it by bumping ECJ and removing that exclusion; verify.groovy then asserts that module-info.class, Base.class and Use.class are produced.

No production code changes — this is a reproducer kept in-tree so the fix can be verified immediately.

Verification

  • mvn -B -o spotless:apply and -Dspotless.action=check spotless:check: clean.
  • mvn -B -o verify -pl plexus-compiler-its -am (JDK 21): BUILD SUCCESS, 12 ITs passed, new IT excluded.
  • Running it explicitly with -Dinvoker.test=ecj-single-module-sourcepath: fails with the exact upstream error, confirming the fixture reproduces the bug:
    module-info.java:[2,13] The package demo.lib does not exist or is empty
    module-info.java:[3,13] The package demo.use does not exist or is empty
    

Reproduces eclipse-jdt/eclipse.jdt.core#5759: compiling only module-info.java with sources found through -sourcepath makes ECJ report the exported packages as missing. The IT is excluded via pomExcludes until ECJ is fixed; enabling it then just requires bumping ECJ and removing the exclusion. Part of #548.
@slachiewicz slachiewicz added the maintenance Cleanup, refactoring or other internal change label Nov 18, 2026
@slachiewicz
slachiewicz merged commit c342ea6 into master Nov 18, 2026
27 of 28 checks passed
@slachiewicz
slachiewicz deleted the ecj-single-module-sourcepath-it branch November 18, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Cleanup, refactoring or other internal change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant