Running maven project in neovim

297 Views Asked by At

I recently decided to switch to coding Java in a text editor instead of an IDE like intellij. It is considerably faster to start.

I decided to go with the LazyVim distribution and started configuring it the best I could for java development.

However, whilst the syntax highlighting works fine and same for the autocompletion, the nvim-DAP does not. I don't have a way to just press a button for maven to compile and install the project, being forced to open the terminal and manually type "mvn exec:java -Dexec..."

When I decide to launch the debugger with

SPC-d-a it says the dap is taking too much time or is not attached, even though the lsp is very well attached and detects the root of my project fine. (Failed to attach remote debugee)

Here is my spec

-Fedora linux

Here is what I've already tried:

-Installing nvim-jdtls -copying the configuration I saw in the nvim-dap to my java.lua in my config file

local dap = require("dap")
dap.configurations.java = {
  {
    -- You need to extend the classPath to list your dependencies.
    -- `nvim-jdtls` would automatically add the `classPaths` property if it is missing
    classPaths = {},

    -- If using the JDK9+ module system, this needs to be extended
    -- `nvim-jdtls` would automatically populate this property
    modulePaths = {},
    name = "Launch YourClassName",
    request = "launch",
    type = "java",
  },
}
require("jdtls.dap").setup_dap_main_class_configs() -- discover main class

However, if i open the nvim-DAP ui, I can open the interface and restart the debugger but that is also hit or miss.

IN RESUME I am using lazyvim and can't get the debugger to work properly.

0

There are 0 best solutions below