A Neovim plugin that starts LemMinX with the lemminx-maven extension on the same classpath. It adds completion, hover and diagnostics for dependencies, plugins and properties in pom.xml, and keeps all the regular XML features.
Requires Neovim 0.11+ (vim.lsp.config) and JDK 17+.
If you don't use VSCode, run:
:LemminxMavenInstallIt downloads the latest org.eclipse.lemminx-*-uber.jar and lemminx-maven-*-zip-with-dependencies.zip from the official Eclipse Maven repository (repo.eclipse.org) and unpacks them into stdpath("data")/lemminx-maven/. The download runs in the background. When it finishes, the server restarts on any XML buffers that are already open. You need curl, plus either unzip or tar.
To pick specific versions, pass them as arguments: :LemminxMavenInstall 0.31.2 0.12.0 (LemMinX version, then lemminx-maven version).
With auto_install = true, the download starts automatically the first time you open an XML file and no jar can be found.
If you'd rather manage the jars yourself, the plugin looks for them in this order:
| What | Option | Environment variable | Fallback |
|---|---|---|---|
| LemMinX jar | lemminx_jar / lemminx_home |
$LEMMINX_HOME |
:LemminxMavenInstall directory → ~/.vscode/extensions/redhat.vscode-xml-*/server |
| lemminx-maven and its dependencies | maven_jars / maven_home |
$LEMMINX_MAVEN_HOME |
lemminx_home → :LemminxMavenInstall directory |
You can also put every jar in a single $LEMMINX_HOME directory. The plugin picks the *uber.jar as LemMinX and treats all other jars as extensions, leaving out any org.eclipse.lemminx-*.jar among them. LemMinX always comes first on the classpath.
With lazy.nvim:
{
"JavaHello/lemminx-maven.nvim",
ft = { "xml", "xsd", "xsl", "xslt", "svg" },
cmd = "LemminxMavenInstall",
opts = {},
}All options and their defaults:
require("lemminx_maven").setup({
java_cmd = nil, -- defaults to $JAVA_HOME/bin/java, then java
lemminx_jar = nil, -- path to the LemMinX jar
lemminx_home = nil, -- defaults to $LEMMINX_HOME
maven_home = nil, -- defaults to $LEMMINX_MAVEN_HOME, then lemminx_home
maven_jars = nil, -- explicit list of lemminx-maven jars, skips discovery
extension_jars = nil, -- other LemMinX extension jars
jvm_args = nil, -- e.g. { "-Xmx1G" }
settings = {}, -- LemMinX settings, sent under the `xml` key
auto_install = false, -- run :LemminxMavenInstall when no jar is found
server = {}, -- merged into vim.lsp.config("lemminx-maven"), highest precedence
auto_enable = true, -- call vim.lsp.enable("lemminx-maven") in setup
})The LSP client is named lemminx-maven, so it doesn't clash with the lemminx config shipped by nvim-lspconfig. Don't enable both, though, or two XML servers will run side by side.
Fields such as on_attach and capabilities can be passed through server, or set in after/lsp/lemminx-maven.lua.
:checkhealth lemminx_maven