microsoft / microsoft/vscode-java-dependency

Java project in subdirectory of workspace

Open
#572 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
199
Forks
105
Avg merge
1d 22h
Merged PRs (30d)
27

Description

Hello,

I'm in the same situation as https://github.com/microsoft/vscode-java-dependency/issues/493 and would like to understand how things are supposed to be configured.

I'm having a folder structure like

my-project/ (workspace)
 L java-app/
   L pom.xml
 L frontend/
 L some-other-sub-project/
 L my-project.code-workspace

My workspace file looks like

{
	"folders": [
		{
			"path": "."
		}
	],
	"launch": {
		"configurations": [
			{
				"type": "java",
				"name": "Launch My project java app",
				"request": "launch",
				"mainClass": "com.example.javaApp.MainClass"
				"envFile": "${workspaceFolder}/.env",
				"projectName": "java-app",
				"args": "--spring.profiles.active=development"
			}
		],
		"compounds": []
	}
}

But

  • the "Java Projects" section in the explorer is empty
  • when running my launch config I'm getting

    ConfigError: The project 'newstimeline-server' is not a valid java project.

When I change my workspace to

	"folders": [
		{
			"path": "."
		},
                {
			"path": "java-app"
		},
	],

then my project is shown in the "Java Projects" section and I can get the launch config to somehow work.
But that seems more like a workaround.

How would the java extension pack expect me to configure this situation?

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 reported workspace layout with java-app/pom.xml and the provided .code-workspace launch configuration. Start by investigating how the Java extension discovers projects in nested workspace folders and resolves projectName. Done means the Java Projects view recognizes the nested project without adding java-app as a separate workspace folder, and the launch configuration works consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.