redhat-developer / redhat-developer/vscode-java

${project.basedir} in pom.xml interpreted wrongly to a wrong absolute path in Windows 10.

Open
#2,298 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Environment
  • Operating System: Windows 10
  • JDK version: 14
  • Visual Studio Code version: 1.63.2
  • Java extension version: 0.20.0 (Extension pack)
Steps To Reproduce
  1. Set sourceDirectory in pom.xml to ${project.basedir}
  2. Update project and use the command palette to open Java: Configure Classpath.
  3. See the result.
  4. Change ${project.basedir} to ${project.basedir}/src or anyone else. Repeat the steps above and see result.
    [Sample project reproducing the error]https://github.com/Berkeley-CS61B/skeleton-sp21/tree/master/lab2setup
Current Result
  • ${project.basedir} is interpreted as a fake absolute path. For example: Users\aoliu\OneDrive\Projects\cs61b-sp21\lab2setup which should be C:\Users\aoliu\OneDrive\Projects\cs61b-sp21\lab2setup in Windows 10.
  • ${project.basedir}\src or other path that under the basedir is correctly interpreted. For example: ${project.basedir}\src is interpreted as src, a relative path.
    image

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

Start with the linked sample project and reproduce the issue using the Java: Configure Classpath command on Windows 10. Compare how ${project.basedir} and ${project.basedir}/src are resolved; done means the basedir retains its Windows drive letter and produces the correct classpath.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript
Domain
build-system, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.