javagitmavenvisual-studio-codejunit

Maven: Multi repo workspace - Test Runner for Java VS Code not finding junit tests


Using a multi repo workspace our junit tests aren't being found by the Test Runner in VS Code. Meaning I can't run any tests directly in VS Code. If I run maven in a terminal/command the tests runs how I expect it to. The tests exist inside the web folder.

workspace/
├─ Repo 1/
│  ├─ automation folder/
│  │  ├─ src/
│  │  │  ├─ test/
│  │  │  │  ├─ web/
│  ├─ pom.xml
├─ Repo 2/

If I move the pom file up into the workspace folder it sees my files as junit tests and I can run them directly in VS code again.

workspace/
├─ Repo 1/
│  ├─ automation folder/
│  │  ├─ src/
│  │  │  ├─ test/
│  │  │  │  ├─ web/
├─ Repo 2/
├─ pom.xml

Is there a way to config VS code to recognize the files are junit tests when the pom is inside Repo 1.

If that isn't possible is there a way to commit files to Repo 1 when they exist outside of the folder?


Solution

  • Ended up just removing the Repo 1 folder with a new clone of the repo.

    git clone REPO1 .