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

Project with module-info not runnable #1272

Open
dsyer opened this issue Feb 27, 2023 · 3 comments
Open

Project with module-info not runnable #1272

dsyer opened this issue Feb 27, 2023 · 3 comments

Comments

@dsyer
Copy link

dsyer commented Feb 27, 2023

As reported here: redhat-developer/vscode-java#881. It's also a problem with Gradle so most of that issue is about that, but there doesn't seem to be an issue logged for Maven, so this is a starting point for that.

Repeating what I said there: just download a project from start.spring.io and add a module-info.java. You might need to tweak the one that VSCode generates for you. This worked for me in a vanilla Boot/Webflux app with Actuators:

module demo {
    exports com.example.demo;

    requires spring.beans;
    requires spring.boot;
    requires spring.boot.autoconfigure;
    requires spring.boot.actuator;
    requires spring.boot.actuator.autoconfigure;
    requires spring.context;
    requires spring.core;
    requires spring.web;

    opens com.example.demo to //
            spring.core, spring.web, spring.beans, spring.context, spring.boot, com.fasterxml.jackson.databind;
}

YMMV. I had to delete the tests because VSCode is confused about test dependencies and the module path. And the app was runnable from the command line, but not in the IDE (incomprehensible errors starting with java.instrument not being available).

You can get something to work by adding java.instrument to the requirements in module-info, but since that isn't actually a requirement, that seems like a bug. I also have experienced other issues once that one is out of the way, but those do not show up with the simple out of the box project as described above.

@laeubi
Copy link
Member

laeubi commented Feb 27, 2023

@dsyer thanks for you report, sadly module support has gotten very little interest by the usual m2e contributors
and it seems this is not really something the usual committer/contributors encounter and thus handled with very low priority, so probably you like to provide a PR to fix that together with a test-case to verify it works?

Beside that, sponsoring is a good way to get specific issues fixed, so if this is crucial to your business and you likes to speed up the development of m2e in general a sponsoring would allow me to assign more time-slots to bug fixing or contact me for an individual contract for example fixing a specific issue.

@dsyer
Copy link
Author

dsyer commented Feb 27, 2023

No thanks. I don't personally care that much, but it's good to have a place to send people if they come across this problem. The fact that m2e did not track this bug seemed like an omission.

@laeubi
Copy link
Member

laeubi commented Feb 27, 2023

@dsyer there are some issues regarding module support, but as said no one has cared (enough) at the moment:

and honestly if vscode-java is using m2e it should be there concern to help addressing issues in libraries they depend on so feel free to "send people here" but don't expect that this changes much unless some dev-effort or money is contributed or someone find it interesting enough to fix it.

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

2 participants