redhat-developer / redhat-developer/vscode-java

Handle module projects with separate module-info.java for main and test sources

Open
#2,116 8 comments 0 reactions 1 assignee View on GitHub

@testforstephen is already working on this.

Since Sep 26, 2021.

JPMS
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Here is a Java 11 maven module project: https://github.com/microsoft/gctoolkit. The project is a multi-module maven project. One submodule is "api", see its file structure as follows. It describes the module-info.java file in the main sources and the test sources respectively.

api
├───src
│   ├───main
│   │   ├───java
│   │   │   │   module-info.java
│   │   │   └───com.microsoft.gctoolkit
│   │   │           GCToolKit.java
│   └───test
│       ├───java
|       |   |   module-info.java
│       │   └───com.microsoft.gctoolkit.test
│       │           Test.java

However, when opening this project in VS Code, it doesn't work. It reports a compile error: "The project was not built due to "Build path contains duplicate entry: 'module-info.java' for project 'api'". Fix the problem, then try refreshing this project and building it since it may be inconsistent". It doesn't support multiple module-info.java files in one Java project.

image

The same project works in maven command line. There should be some gap in the JDT compiler that needs to be fixed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.