-
Notifications
You must be signed in to change notification settings - Fork 469
vscode-java fails to build project with pom-type dependency #3555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Poking around /Users/kal/.gradle/caches/modules-2/files-2.1, I noticed something peculiar about org.graalvm.polyglot/python-community: it only includes a pom file, and no jars, unlike other dependencies. I noticed that in the Maven setup for embedded GraalPy (see also here), Searching for [jdt "pom dependency"] on Google reveals [jira] [Closed] (MCOMPILER-544) ZipException: zip END header not found on POM dependency with Eclipse compiler:
The issue seems to have been tracked in apache/maven-compiler-plugin#198 and codehaus-plexus/plexus-compiler#302. |
It looks like the issue was reported to the Eclipse JDT project (eclipse-jdt/eclipse.jdt.core#1274) but they closed the issue without a fix, and the fix was made in the Maven Compiler Plugin (see link in previous comment). IIUC, that would mean that a fix similar to apache/maven-compiler-plugin#198 would be needed in vscode-java. As mitigation, I wonder if there is a way to get vscode-java to ignore certain dependencies, like the pom-type python-community dependency. |
There is another Eclipse JDT issue related to the Zip problem that is still open: eclipse-jdt/eclipse.jdt.core#1578 |
Ok I have found a partial mitigation but it is not complete. I changed
in
Running
|
Adding /Users/kal/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/python-community/23.1.2/2534a71914ae30007251d1f91f67bb5b5b3431d/python-community-23.1.2.pom to |
Ok here might be a better mitigation. It seems like the pom dependencies are just placeholders to pull in other, real dependencies. So I inspected the dependencies of
and determined which ones looked like they were necessary. In build.gradle.kts I replaced
with
and the entries in the Problems pane that I reported appear to have gone away, and there is no discernible difference in the output of It would still be great if the underlying problem of adding these pom-only dependencies to the class path (IIUC) could be fixed. |
Interestingly, vscode-java does not appear to suffer from this issue when using the example GraalPy Maven project (which can be set up with a single command), indicating the issue may be related to Gradle or how vscode-java is using Gradle. |
Also having the issue, with a different file though. |
I am attempting to follow https://www.graalvm.org/latest/reference-manual/python/ in VSCode, but the Java Language Support for VSCode appears to be having some difficulty. Namely, it thinks the project cannot be built, while
./gradlew build
succeeds just fine.Environment
openjdk 21.0.2 2024-01-16
OpenJDK Runtime Environment Homebrew (build 21.0.2)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.2, mixed mode, sharing)
Steps To Reproduce
git clone https://github.com/kalaracey/graalpy-vscode-issue.git
Java Language Server log
Current Result
VSCode's Problems tab has two problems:
Expected Result
No problems, given that
./gradlew build
succeeds.Additional Informations
/Users/kal/.gradle/caches/modules-2/files-2.1/org.graalvm.polyglot/python-community/23.1.2/2534a71914ae30007251d1f91f67bb5b5b3431d/python-community-23.1.2.pom is the only file in its directory.
Outputs from various VSCode tasks:
The text was updated successfully, but these errors were encountered: