Closed mfussenegger closed 1 year ago
At the moment, I'm not aware of any active consumer that is actively using the zip-with-dependencies. In m2e (I fixed the link by the way, thanks for the note), we use the plain jar and use the Maven dependencies libs that are included in m2e itself to add them into the classpath.
This error seems to be that it's not the right version of aether being listed in dependencies here. For reference, here is how the lemminx (+lemminx-maven extension) process is started -successfully- inside my current Eclipse IDE when editing XML files:
mistria 488775 0.1 1.7 13574908 559104 ? Sl Feb09 1:10 /home/mistria/apps/eclipse-SDK/plugins/org.eclipse.justj.openjdk.hotspot.jre.full.linux.x86_64_19.0.2.v20230129-1123/jre/bin/java -Dhttps.nonProxyHosts=localhost|127.0.0.1 -Dhttp.nonProxyHosts=localhost|127.0.0.1 -Dlog.level=FINEST -classpath /home/mistria/apps/eclipse-SDK/configuration/org.eclipse.osgi/882/0/.cp/language-servers/server/org.eclipse.lemminx-uber.jar:/home/mistria/apps/eclipse-SDK/configuration/org.eclipse.osgi/1012/0/.cp/lemminx-maven.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/commons-lang3-3.8.1.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-settings-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-component-annotations-2.1.0.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/guice-4.2.2-no_aop.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-impl-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-connector-basic-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-sec-dispatcher-2.0.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/aether-connector-okhttp-0.17.8.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-interpolation-1.26.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-utils-3.3.1.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-cipher-2.0.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-builder-support-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/commons-cli-1.4.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-transport-wagon-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/wagon-provider-api-3.5.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-artifact-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-repository-metadata-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-shared-utils-3.3.4.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/jansi-2.4.0.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-provider-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-spi-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-model-builder-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-util-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/org.eclipse.sisu.inject-0.3.5.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/okhttp-3.14.1.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-compat-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-embedder-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/okio-1.17.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-classworlds-2.6.0.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-core-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/org.eclipse.sisu.plexus-0.3.5.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-resolver-api-1.6.3.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-slf4j-provider-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/plexus-build-api-0.0.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-plugin-api-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-settings-builder-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/maven-model-3.8.7.jar:/home/mistria/apps/eclipse-SDK/plugins/org.eclipse.m2e.maven.runtime_3.8.700.20230125-0927/jars/wagon-file-3.5.3.jar:/home/mistria/apps/eclipse-SDK/plugins/javax.inject_1.0.0.v20220405-0441.jar:/home/mistria/apps/eclipse-SDK/plugins/slf4j.api_1.7.36.jar org.eclipse.lemminx.XMLServerLauncher
I see it's using another version of the resolver and that aether jars are not in.
Thanks for the list of jars. I played around a bit with including/excluding based on the diff of jars and discovered that excluding the aether jar's (except for the connector-okhttp) fixes the issue.
I created a PR that would exclude them: https://github.com/eclipse/lemminx-maven/pull/361
(And in case anyone runs into this and wonders how to get it working with Neovim: here's a playbook with the installation and the Neovim config: https://github.com/mfussenegger/dotfiles/commit/a6c498a6bc7061f0758a4d6ea36a8f2c3e4899df)
It looks like org.eclipse.aether.repository
content got merged into maven-resolver-api a while ago and the version from maven-resolver-api must take precedence. If the aether-api jar is in the classpath, it may override the other and better version in maven-resolver-api.
When triggering completion I'm getting the following error:
I'm trying to use lemminx-maven in Neovim and suspect I may be missing some dependency in the classpath.
Here's what I did:
git clone https://github.com/eclipse/lemminx
git checkout 0.23.2
./mvnw clean install -DskipTests
with JAVA_HOME set to JDK 17git clone https://github.com/eclipse/lemminx-maven/
git checkout 0.7.1
./mvnw clean -B verify --file lemminx-maven/pom.xml -DskipTests -Dmaven.test.error.ignore=true -Dmaven.test.failure.ignore=true
with JAVA_HOME set to JDK 17Both build fine. I then extracted
lemminx-maven/target/lemminx-maven-0.7.1-zip-with-dependencies.zip
Then I start the language server with:
Where
[...]
is the uber jar for lemminx and the jars from thezip-with-dependencies
(see full list below)I puzzled this together from reading some of the vscode-xml extension code (https://github.com/redhat-developer/vscode-xml/blob/efd52ad1f6e89e962c576795c324621aed7d8370/src/server/java/javaServerStarter.ts#L91).
The README here seems a bit outdated so it's unclear what exactly should go into the classpath E.g. the download link is broken: https://download.eclipse.org/technology/m2e/snapshots/1.16.1/latest/ and there are references to vscode-xml-maven which hasn't had a commit in 4 years.
What I have right now is the following. (The cp separates them in the right format with
:
and they contain the right absolute paths, I list them on a newline each and trimmed the path/to/location for better readability)JARs included in the classpath
``` lemminx/org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar lemminx-maven/dist/aether-api-1.1.0.jar lemminx-maven/dist/aether-connector-basic-1.1.0.jar lemminx-maven/dist/aether-connector-okhttp-0.17.8.jar lemminx-maven/dist/aether-spi-1.1.0.jar lemminx-maven/dist/aether-util-1.1.0.jar lemminx-maven/dist/aopalliance-1.0.jar lemminx-maven/dist/commons-cli-1.4.jar lemminx-maven/dist/commons-codec-1.11.jar lemminx-maven/dist/gson-2.8.9.jar lemminx-maven/dist/guice-4.2.2-no_aop.jar lemminx-maven/dist/httpclient-4.5.14.jar lemminx-maven/dist/httpcore-4.4.16.jar lemminx-maven/dist/isorelax-20030108.jar lemminx-maven/dist/javax.annotation-api-1.2.jar lemminx-maven/dist/javax.inject-1.jar lemminx-maven/dist/jcl-over-slf4j-1.7.36.jar lemminx-maven/dist/jing-20220510.jar lemminx-maven/dist/lemminx-maven-0.7.1.jar lemminx-maven/dist/maven-artifact-3.8.7.jar lemminx-maven/dist/maven-builder-support-3.8.7.jar lemminx-maven/dist/maven-compat-3.8.7.jar lemminx-maven/dist/maven-core-3.8.7.jar lemminx-maven/dist/maven-embedder-3.8.7.jar lemminx-maven/dist/maven-model-3.8.7.jar lemminx-maven/dist/maven-model-builder-3.8.7.jar lemminx-maven/dist/maven-plugin-api-3.8.7.jar lemminx-maven/dist/maven-repository-metadata-3.8.7.jar lemminx-maven/dist/maven-resolver-api-1.9.4.jar lemminx-maven/dist/maven-resolver-impl-1.9.4.jar lemminx-maven/dist/maven-resolver-named-locks-1.9.4.jar lemminx-maven/dist/maven-resolver-provider-3.8.7.jar lemminx-maven/dist/maven-resolver-spi-1.9.4.jar lemminx-maven/dist/maven-resolver-util-1.9.4.jar lemminx-maven/dist/maven-settings-3.8.7.jar lemminx-maven/dist/maven-settings-builder-3.8.7.jar lemminx-maven/dist/maven-shared-utils-3.3.4.jar lemminx-maven/dist/okhttp-3.14.1.jar lemminx-maven/dist/okio-1.17.3.jar lemminx-maven/dist/org.eclipse.lemminx-0.23.2.jar lemminx-maven/dist/org.eclipse.lsp4j-0.14.0.jar lemminx-maven/dist/org.eclipse.lsp4j.generator-0.14.0.jar lemminx-maven/dist/org.eclipse.lsp4j.jsonrpc-0.14.0.jar lemminx-maven/dist/org.eclipse.sisu.inject-0.3.5.jar lemminx-maven/dist/org.eclipse.sisu.plexus-0.3.5.jar lemminx-maven/dist/org.eclipse.xtend.lib-2.24.0.jar lemminx-maven/dist/org.eclipse.xtend.lib.macro-2.24.0.jar lemminx-maven/dist/org.eclipse.xtext.xbase.lib-2.24.0.jar lemminx-maven/dist/plexus-cipher-2.0.jar lemminx-maven/dist/plexus-classworlds-2.6.0.jar lemminx-maven/dist/plexus-component-annotations-2.1.0.jar lemminx-maven/dist/plexus-interpolation-1.26.jar lemminx-maven/dist/plexus-sec-dispatcher-2.0.jar lemminx-maven/dist/plexus-utils-3.3.1.jar lemminx-maven/dist/remark-1.0.0.jar lemminx-maven/dist/slf4j-api-1.7.36.jar lemminx-maven/dist/wagon-file-3.5.3.jar lemminx-maven/dist/wagon-http-3.5.3.jar lemminx-maven/dist/wagon-http-shared-3.5.3.jar lemminx-maven/dist/wagon-provider-api-3.5.3.jar lemminx-maven/dist/xercesImpl-2.12.2.jar lemminx-maven/dist/xml-resolver-1.2.jar ```Using only
lemminx/org.eclipse.lemminx/target/org.eclipse.lemminx-uber.jar
without the lemminx-maven jars works fine but I'm of course missing the lemminx-maven features.I'd appreciate any pointers.