VS Code with Java plugins, using Maven POMs for a test application that uses classes in a jar that reference classes in another jar results in runtime error saying that the class referenced from the required .class file cannot be resolved. Both jars are installed to the local maven repository. All dependencies are specified in their respective POMs. This happens when running from within VSCode using a launch (without a launch.json file). Shouldn't the classpath at runtime be able to pick up the recursive dependencies?
Asked
Active
Viewed 70 times
1
-
What happens when you just run `mvn verify` from a terminal instead of using VS Code/launch.json? – martinspielmann Sep 30 '20 at 20:28
-
man verify runs without reporting any problems. – rdiddly Oct 01 '20 at 11:57
-
1It looks like, if you have multiple folders in your VS Code project, where each builds to a jar which gets copied to a local maven repository which is used at runtime to satisfy the external references, this completely messes up the Java plugins unless you Restart Extension Host. Having figured out this workflow I am able to be productive in this environment. Before that, when trying to compile other part of the project, the compilation step would fail due to missing classes (defined in one of the other sub-projects if you will) which had been updated. The whole environment becomes unusable. – rdiddly Oct 02 '20 at 18:12
-
We can't get more detailed information to reproduce this issue, and if it's verified as a bug, it's important for engineers to fix, then users can achieve better experience. Would you mind sharing your project in OneDrive or GitHub if it's convenient? – Molly Wang-MSFT Oct 23 '20 at 03:22
-
Unfortunately, the client does not allow the project to be shared. In the meantime, I have moved to the community edition of IntelliJ which comes with its own issues, but seems to be rather better integrated with VCS (git) and does not exhibit this issue. There is also no guarantee that if you were to reproduce the circumstances, which is that there are 3 jars and one application dependent upon them in a cascade fashion, each a different module in a VS Code project, you would see the same behavior. Sorry I can't help. – rdiddly Oct 26 '20 at 12:49
-
It's okay, If you wanna switch back to VS Code, Welcome! Happy Coding:) – Molly Wang-MSFT Oct 30 '20 at 08:25