| Summary: | Java module not found at runtime even with requires transitive | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Sam Peters <eclipse-devel> |
| Component: | m2e | Assignee: | Till Brychcy <register.eclipse> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | b.michael, f.rajchenbach, fbricon, register.eclipse |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| See Also: |
https://git.eclipse.org/r/137086 https://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=da6ee5f46781db27c9775f765ebffcc30bac036f |
||
| Whiteboard: | |||
|
Description
Sam Peters
I guess org.eclipse.jdt.internal.compiler.env.IModule.IModuleReference.isTransitive() needs to be handled in org.eclipse.m2e.jdt.internal.InternalModuleSupport.getRequiredModules(File, int) Moving to m2e. @Till Brychcy: I installed http://subclipse.tigris.org/m2eclipse/latest/ (Maven Integration for Subclipse) via Install New Software, but NOT m2e (Maven Integration for Eclipse) via Eclipse Marketplace. Could you reproduce my problem with m2e as well? Perhaps it's not m2e related... Are you sure? m2eclipse is the predecessor of m2e and AFAIK not at all supported anymore, so I strongly doubt it supports configuring the module path. Can you reproduce the problem in a pure eclipse workspace (without any pom.xml involved, projects created in eclipse and buildpath directly configured in eclipse)? @Till Brychcy: Ok, I looked in the Eclipse installation details and searched for "Maven": There are only m2e entries (along with one m2e entry under "Maven SCM handler for Subclipse" that we use for "Checkout as Maven project..." from the SCM view). So I think you are right, we are talking about a problem in m2e. Sorry for the confusion.
> Can you reproduce the problem in a pure eclipse workspace (without any pom.xml involved, projects created in eclipse and buildpath directly configured in eclipse)?
I created four Java Projects with main classes and build-info's, added the depending modules to Java Build Path > Projects > Modulepath of the project settings (e. g., for project D I added C and so on) and run class D. I don't get any errors at runtime with this setup. So, it's likely a problem with m2e.
(In reply to Till Brychcy from comment #1) > I guess > org.eclipse.jdt.internal.compiler.env.IModule.IModuleReference. > isTransitive() needs to be handled in > org.eclipse.m2e.jdt.internal.InternalModuleSupport.getRequiredModules(File, > int) > That guess was wrong, as required transitive dependencies are needed for runtime anyway. Bug is in the recursive invocation in org.eclipse.m2e.jdt.internal.InternalModuleSupport.collectTransitiveRequiredModules(Set<String>, Set<String>, Map<String, IClasspathEntryDescriptor>, IProgressMonitor, int). The first arg contains the final result, to passing the local variable transitiveModules as first arg is wrong. New Gerrit change created: https://git.eclipse.org/r/137086 In patch set 2, I've re-optimised the implementation so the inner iteration is not over the incrementally computed result set, but just over the transitive modules computed in the last outer iteration (as was probably intended in the original implementation, where the outer iteration was done via recursion). I haven't found any example tests with module-info. Is there any test-infrastructure for Java 9-related tests at all? Gerrit change https://git.eclipse.org/r/137086 was merged to [master]. Commit: http://git.eclipse.org/c/m2e/m2e-core.git/commit/?id=da6ee5f46781db27c9775f765ebffcc30bac036f Thanks for the fix Till. Indeed I forgot we still don't have the test framework for Java 9+ projects. It's on my todo list. *** Bug 525930 has been marked as a duplicate of this bug. *** |