I'm testing Theia as an Eclipse replacement IDE for my Java projects and am trying to replicate the familiar project structure: a workspace directory containing a folder per project, each project depends on external jars and other projects. E.g.
prjAdepends onsome.jar(copied into thelibsubdirectory)prjBdepends onother.jarand onprjA
Even though Theia is not a fork of VSCode, its structure is heavily influenced by it (for extensions compatibility I guess?) but I was unable to find anything for VSCode too.
I have been able to create my two Java projects, each with .vscode/settings.json (and also .theia/settings.jsons, which I put to the same content):
prjA/.vscode/settings.json:
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": ".bin",
"java.project.referencedLibraries": [
"lib/**/*.jar"
]
}
prjB/.vscode/settings.json:
{
"java.project.sourcePaths": ["src"],
"java.project.outputPath": ".bin",
"java.project.referencedLibraries": [
"lib/**/*.jar",
"../prjA/.bin"
]
}
(note the added "../prjA/.bin" in prjB).
Yet, I cannot have intellisense detecting the classpath correctly in prjB: classes from external jars are properly identified, but the ones from prjA still show with red waves with The import xxx cannot be resolved.
I tried adding ../prjA/src as an additionnal sourcePaths (through a link because it won't let me add a source folder not in its root), but it compiles prjA's classes into prjB/.bin, which I obviously don't want (but the "import cannot be resolved" errors disappear though).
So, how should I approach Java projects dependencies in a multi-root workspace? (Preferably for Theia, but curious about VSCode as well).