Add java-opts in Idea at runtime

Hi,

for the ldap connection I need to add -Djavax.net.ssl.trustStore=[…my_trustore]
I tried it like this, but does not work:
image

I do not see, what I am doing wrong :frowning:

any idea?

Hi,
The VM options in the run configuration are VM options for the Gradle process, not for the application process.

Here is what official documentation says how to pass system properties to the application:
https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#running-your-application.passing-system-properties

and stackoverflow:

This worked for me:

bootRun {
    if (System.getProperty('jvmArgs')) {
        jvmArgs = (System.getProperty('jvmArgs').split("\\s+") as List)
    }
}

image

1 Like

great! that works, thx…