Skip to content
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

Modular jar with a dependency marked as being an automatic module #1089

Open
theit opened this issue Nov 25, 2022 · 0 comments
Open

Modular jar with a dependency marked as being an automatic module #1089

theit opened this issue Nov 25, 2022 · 0 comments

Comments

@theit
Copy link

theit commented Nov 25, 2022

Hi,

I have a non-modular project A in my workspace that uses m-jar-p 3.3.0 to add the entry com.example.a as automatic module name to its manifest. The project itself builds fine on the command line and also inside Eclipse.
A is used as a dependency in another project B. When I build B on the command line having requires com.example.a in the module-info.java, everything works fine.
In Eclipse this entry is marked with an error so referenced classes from A aren't available. Fixing this error results in requires a in the module descriptor, i.e. the workspace project name, but not the real automatic module name. Therefore the project cannot be built successfully on the command line.

What really puzzles me:
Install A into my local .m2 folder via "mvn clean install", close the project in Eclipse, use the real automatic module name in B's module descriptor => everything works...

I'm using a fresh installation of Eclipse with Adoptium Java 19.0.1:
Version: 2022-12 RC1 (4.26.0 RC1)
Build id: 20221124-2251
M2E - Complete Development Kit: 2.1.0.20221122-2114
M2E - Maven Integration for Eclipse: 2.0.6.20221122-2114
M2E - PDE Integration: 2.0.2.20221122-2012
M2E - POM Editor using LemMinX language server (includes Incubating components): 2.0.1.20221120-2121
M2E - SLF4J over Logback Logging: 2.1.0.20221015-0744

This seems similar to a problem I once had a couple of years ago:
https://www.eclipse.org/lists/m2e-users/msg05756.html

I've added an example with which you can reproduce the above mentioned behaviour:
example.tar.gz

Do I miss something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant