Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference other unmanaged folders as dependencies #2853

Open
javierjcf opened this issue Jan 3, 2023 · 3 comments
Open

Reference other unmanaged folders as dependencies #2853

javierjcf opened this issue Jan 3, 2023 · 3 comments

Comments

@javierjcf
Copy link

[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.

@javierjcf javierjcf changed the title Add src folThe source path must be contained in the project root folder. Add src follder error: The source path must be contained in the project root folder. Jan 3, 2023
@jdneo
Copy link
Collaborator

jdneo commented Jan 4, 2023

AFAIK, if you are using project without build tools (unmanaged folder), we do not support referencing another unmanaged folder as a dependency today.

@jdneo jdneo changed the title Add src follder error: The source path must be contained in the project root folder. Reference other unmanaged folders as dependencies Jan 4, 2023
@testforstephen testforstephen added the dependencies Pull requests that update a dependency file label Feb 8, 2023
@anandbibek
Copy link

@javierjcf could we try opening the lowest common parent folder in vscode and mark the different unmanaged folders as "src" in .classpath file?

This plugin will help in setting up a local project in the parent folder.
https://marketplace.visualstudio.com/items?itemName=mellena1.eclipse-new-java-project

@jdneo jdneo removed the dependencies Pull requests that update a dependency file label Feb 12, 2023
@ryanmkurtz
Copy link

ryanmkurtz commented Nov 25, 2024

I am looking for a way to add an external bin/main (for example) to my settings.json, such that it gets put on the class path. I think this ticket is asking for the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants