redhat-developer / redhat-developer/vscode-java

Maven sub modules do not update when parent pom.xml is edited

Open
#841 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[provide a description of the issue]
When adding or removing modules in the top pom.xml, the JAVA DEPENDENCIES which depends on Language Support for Java(TM) by Red Hat(redhat.java) is not updated even after VSCode is restarted.

Environment
  • Operating System: Windows 10 Pro 1809 OS build 17763.379
  • JDK version: Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)
  • Visual Studio Code version: 1.32.3(user setup)
  • Java extension version: Language Support for Java(TM) by Red Hat(redhat.java) 0.41.0, Java Dependency Viewer(vscjava.vscode-java-dependency) 0.3.0
Steps To Reproduce
  1. Manually create a maven project with several sub modules. Each sub module has its own folder and src/main/java inside its own folder.
  2. Edit the parent pom.xml, to add or remove modules. There is no change in the JAVA DEPENDENCIES. Even do Update project configuration to any pom.xml has no effect.
  3. In src/main/java of the sub modules, create empty class with main method. Open the class in the VSCode, if a module does not appears in the JAVA DEPENDENCIES, no "Run | Debug" line appears on the top of main method.
  4. However, by searching the opened workspace in workspace storage(%APPDATA%\Code[ - Variant]\User\workspaceStorage), like(I have grep.exe on my Windows):
    grep -e "test-vscode-maven" %APPDATA%\Code\User\workspaceStorage\* -r
    There would be some results like:
    .......AppData\Roaming\Code\User\workspaceStorage\e8caf83cfcdbff47843f66c1e0d4be69/workspace.json: "folder": "...........test-vscode-maven/module3"
    And manually remove ".......AppData\Roaming\Code\User\workspaceStorage\e8caf83cfcdbff47843f66c1e0d4be69\redhat.java" folder,
    Then restart VSCode, the problem solved.
  5. From the attach logs, do Java: Clean the Java language server workspace could also solve the problem, I find this when I'm going to commit this bug. It's still a reproducible problem.

[attach a sample project reproducing the error]
https://github.com/jchprj/test-vscode-maven

Current Result

There is no change in the JAVA DEPENDENCIES.

Expected Result

There should be changes corresponding the modules in parent pom.xml.

Additional Informations

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.

Research direction

Reproduce the issue with the linked test-vscode-maven project by adding and removing modules in the parent pom.xml, then inspect how the Java Dependencies view handles the change. Compare Update project configuration and Java: Clean the Java language server workspace; done means the dependencies and Run/Debug links reflect the current modules without deleting workspace storage manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.