You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When the debugger stops at a breakpoint, it loads the source in target/classes, not src/java #823
(I thought I'd raised this already, not sure where it went)
This is more of a question or feature request than an issue
I'm making some changes to a Maven project (which I didn't write originally) in VS Code. As part of this, I need the debugger, since I make mistakes.
The build process seems to involve creating a copy of each source file in the target/classes folder. That's OK, except...
When stopping at a breakpoint, VSCode tends to load this copy, and not the original source file. It is OK to work with the original as I can load that separately, set breakpoints from there, etc.
But intellisense and hovers don't work in the target/classes version, and if I make edits there they don't persist of course.
How do I configure the debugger not to look in target/classes to find source files?
Environment
Operating System: WIndows 10
JDK version: 1.8
Visual Studio Code version: 1.45.1
Java extension version: 0.9.1
Java Debugger extension version: 0.26.0
Steps To Reproduce
Not easy to do this, I cannot share the code
Current Result
When I stop at a breakpoint, VSCode displays the source file from target/classes, not the one in src/java
The source mapping is based on the your project's classpath, it's not configurable in the debugger extension. The project loading service is provided by vscode-java extension. Look like your project mixed the source with the target/classes.
Could you please attach a sample project to help reproduce the problem? At least share your pom.xml file.
Im having an issue changing the webroot and the sourceMapPathOverrides when i launch the debugger, I can break in the java code, but it doesn't recognize other breaks. I've tried adding an attach to process in a launch.json in the vscode-java extension, am I on the right path?
The source mapping is based on the your project's classpath, it's not configurable in the debugger extension. The project loading service is provided by vscode-java extension. Look like your project mixed the source with the target/classes.
Thanks for the reply
Could you please attach a sample project to help reproduce the problem? At least share your pom.xml file.
It turns out this was a red herring. It was a bug in the POM left by the original author. The Java files were listed as resources, and so copied.
Activity
testforstephen commentedon Jun 3, 2020
The source mapping is based on the your project's classpath, it's not configurable in the debugger extension. The project loading service is provided by vscode-java extension. Look like your project mixed the source with the target/classes.
Could you please attach a sample project to help reproduce the problem? At least share your pom.xml file.
greenwave01 commentedon Jun 11, 2020
Im having an issue changing the webroot and the sourceMapPathOverrides when i launch the debugger, I can break in the java code, but it doesn't recognize other breaks. I've tried adding an attach to process in a launch.json in the vscode-java extension, am I on the right path?
phudson commentedon Jun 11, 2020
Thanks for the reply
It turns out this was a red herring. It was a bug in the POM left by the original author. The Java files were listed as resources, and so copied.
Sorry about this spurious ticket!
phudson commentedon Jun 11, 2020
This is probably entirely unconnected with my issue. I suggest you raise a separate issue about it.