redhat-developer / redhat-developer/vscode-java

Reference other unmanaged folders as dependencies

Open
#2,853 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[provide a description of the issue]

Environment
  • Operating System: ANY
  • JDK version: 11
  • Visual Studio Code version: 1.74.2
  • Java extension version: Any
Steps To Reproduce
  1. Create a javaproject 0, a package and a class
  2. Create other project 1 a package and a class where you use class of project 0.

Suppose I have 4 independent Java projects: project0, project1, project2, and project3.

Inside each project, I have the src folder, and inside some packages and classes. Project 1, 2, and 3 use classes from project0.

In Eclipse, I can indicate in a section that the sources of project 0 are used. When I try something similar in VScode, I go to configure the classpath of project one and see that it includes its src folder. When I add the src folder of project0, I get the following error: "The source path must be contained in the project root folder."

I can solve this by creating the .jar of project 0 and adding it to the other projects, but this is very inconvenient when making quick tests.

I know there are tools like Maven or Ant to do these things, but I would like to know if there is any way to indicate in vscode that one project uses classes from another without having to include the .jar as a dependency.

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

No source files, tests, or entry points are named. Start by reproducing the four-project setup and tracing the Java extension's classpath configuration, especially the source-path validation. Done would mean project1, project2, and project3 can reference project0's unmanaged sources without building a JAR or triggering the project-root error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.