Cannot load project in VSCode
Describe the bug
VSCode (correctly configured for Java development) fails to load the projects.
To Reproduce
- Open VSCode (with Microsoft's 'Extension Pack for Java' extension installed
- Ctrl+Shift+P > Java: Configure Java Runtime > Project Settings > Classpath > JDK Runtime> JDK: JavaSE-21
- File > Open folder... > (specify path to git-cloned LibrePDF/OpenPDF source).
- Allow build to finish
- Open any .java source
- Observe problem markers about unresolved java.* class references
- Ctrl+Shift+P > Developer: Open Logs Folder, drill down to exthost\output_logging_20251106T145936\4-Language Support for Java.log,
- Note the exception: org.eclipse.core.runtime.CoreException: Could not update project openpdf-html configuration ...Caused by: java.lang.IllegalArgumentException: Path must include project and resource name: /
- Open /openpdf-html/pom.xml and comment out lines 92 - 98 <resource><directory>../</directory>...</resource>, then save the file.
- Allow build to finish
- Observe problem markers mentioned in 6.) have gone away. (Note that there are still > 1,000 other problems, including lots of raw type issues.)
- CoPilot suggests using the maven-resources-plugin:copy mojo to copy the LICENSE.* from the parent ../META-INF/ folder.
Expected behavior
When a correctly configured VSCode opens a 3rd party Maven project at its root folder, the project and its sub-modules should all be correctly imported as Java projects.
Screenshots
N/A
System
- OS: Windows 10 (Windows_NT x64 10.0.19045)
- Used font: N/A
- OpenPDF version: 3.0.1-SNAPSHOT
- VSCode Version: 1.105.1 (user setup) Commit: 7d842fb85a0275a4a8e4d7e040d2625abbf7f084
Your real name
Adrian Price
Additional context
I only embarked upon this course of action in order to understand why openpdf-html ignores the HTML entities for certain Unicode characters such as ★ ☆ ☐ ☒ which I wanted to use for rendering star ratings and check-boxes. I shall log this as a separate issue.
Pull requests welcome. Thank you for reporting.
Did you try IntelliJ IDEA? It's a better code editor.
Pull requests welcome. Thank you for reporting.
Did you try IntelliJ IDEA? It's a better code editor.
Thanks for the response. Yes, I have used IntelliJ IDEA in the past and loved it. I also worked for many years developing plugins for the Eclipse IDE, which is also excellent and far more rounded and capable than VSCode. Anyhow, I'm kinda stuck with VSCode for the time being, and this particular issue is not a blocker for my Evidence Engine project.