How to set system properties in IntelliJ IDEA 13 gradle task?

I have a Spring boot project with a gradle build tool. The JDBC URL, username and password are stored in the properties file, which is not part of the application, it is an external property file, the path to the property file is taken from the system properties as follows.

export _JAVA_OPTIONS=-DdatabaseConfiguration=db.properties

It works if I start the application from the terminal using gradle bootRun, but when I try to start tasks from Intellij IDEA 13 gradle that it does not work, the value of the property is null.

I tried the parameters of the virtual machine in the "Run / Debug" configuration, since in the screen below it’s not possible to shoot it.

Run / Debug Configuration

How JAVA_OPTIONS can be set in Intellij IDEA 13 gradle tasks.

+4
1

, , Gradle IntelliJ, / .

, Gradle . ( ) . Launch Config Gradle.

: :

  • - > , , - > → Gradle → Gradle VM
  • (.. -Dappengine.sdk.root=/opt/google/google-cloud-sdk/platform/appengine-java-sdk)

, / , Gradle.

: Gradle , . , env vars.

appengine- gradle -plugin

-Dappengine.sdk.root=/opt/google/google-cloud-sdk/platform/appengine-java-sdk

VM, env vars. env vars . appengineRun.

appengineUpdate, , env vars: Toolkit not found: apple.awt.CToolkit

+1

All Articles