mfussenegger / nvim-dap

Debug Adapter Protocol client implementation for Neovim
GNU General Public License v3.0
5.1k stars 179 forks source link

Add environment variables #1139

Closed gernhan closed 5 months ago

gernhan commented 5 months ago

Problem Statement

How can I add environment variables for a spring application like this:

export IMPORT_LOCATION=./src/test/resources/import-test
export IMPORT_OPERATION=FETCH
export LOAD_TEST_DATA=TRUE
export ENABLE_MASTER_DATA=TRUE
export PREFILLED_IMPORT_TABLES=FALSE
export PREFILLED_IMPORT_TABLES=FALSE
export HELPER_STARTUP_FILENAME=helper-setting.yaml

mvn spring-boot:run

Possible Solutions

No response

Considered Alternatives

No response

mfussenegger commented 5 months ago

java-debug supports a env property in the configuration.

See https://github.com/microsoft/vscode-java-debug#options

E.g. with a launch.json file:

{
   "version": "0.2.0",
   "configurations": [
       {
           "type": "java",
           "request": "launch",
           "name": "Launch",
           "mainClass": "jdtlsdemo.App",
           "console": "integratedTerminal",
           "env": {
             "FOO": "yes"
           }
       }
   ]
}

And the App:

package jdtlsdemo;

public class App {

    public static void main(String[] args) {
        System.out.println(System.getenv("FOO"));
    }
}