-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Junit5 tests with module-info fails #1812
Comments
Currently ECJ does not allow javacode in module-info.java but that might change. See for example eclipse-jdt/eclipse.jdt.core#3347 |
Hmm. Is there any evidence here that the "problematic" module-info.java contains any java code other than module description ?? I am wondering if there is really a connection to eclipse-jdt/eclipse.jdt.core#3347 I think this should be investigated by JDT-UI folk and I will forward it there. |
Please note that I have no java code inside the module-info.java files, eclipse-jdt/eclipse.jdt.core#3347 is likely not the issue. |
Since I really would like to get this resolved, I have created a minimal Maven project that reproduces the issue. Please clone this repo and find that:
|
Please contribute a PR that fixes the issue. |
I've tried to run your project @xazap - I found a couple of issues, but they are different than you mentioned.
I'm using Maven 3.9.9. Second, running the test from Eclipse fails with:
It seems that in the freshly launched VM, those classes are not accessible to the launcher classes, they are not opened up. I could hack this, with using
in the
in the module file, but I couldn't find a solution, with both Eclipse and Maven are happy. |
Yes, I get that too sometimes. This is not an issue with my sample project, but rather a side effect of using the project in Eclipse before running it from the command line. Eclipse appears to be opinionated about missing If you remove the erroneously added
Interesting, with some experimentation I could also get this same stacktrace. It appears that different stacktraces appears depending on you what you select before performing
Thanks, This fixes some things:
|
We arrive at three issues:
|
Given
Expectation
I expected Eclipse to run the junit tests successfully since the Maven build executes correctly, proving that dependencies and and module references are setup correctly.
Findings
An internal error occurred during: "Launching java (6)". Index 0 out of bounds for length 0
provides interface with implementation
clauses in the module descriptor of the test project.Tested under this environment:
Linux 6.8.0-49-generic 49-Ubuntu SMP PREEMPT_DYNAMIC Mon Nov 4 02:06:24 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Version: 2024-09 (4.33.0)
Build id: 20240905-0614
No additional plugins installed
java version "21.0.4" 2024-07-16 LTS
Java(TM) SE Runtime Environment (build 21.0.4+8-LTS-274)
Java HotSpot(TM) 64-Bit Server VM (build 21.0.4+8-LTS-274, mixed mode, sharing)
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
The text was updated successfully, but these errors were encountered: