Reputation: 12807
I have a simple Ktor application using application.conf
files. The documentation mentions that I can specify a custom configuration file to use as such :
Now, I would like to do exactly the same, except that I start my application using ./gradlew run
.
Using ./gradlew run -config=...
won't even run, while using ./gradlew run -Dconfig=...
seems to gloriously ignore the input I give it.
What is the proper way to provide a custom configuration time when starting my Ktor server with gradle?
Upvotes: 0
Views: 1272
Reputation: 52
Supplement.
If you use idea to run a program, you can add the -config
parameter to Program arguments
.
Upvotes: 1
Reputation: 12807
Ok, answering my own question after further research. The answer in this case is to run gradle as such :
$./gradlew run --args="-config=src/main/resources/application.test.conf
As per [the gradle documentation](https://docs.gradle.org/current/userguide/application_plugin.html#:~:text=Since%20Gradle%204.9%2C%20the%20command,setArgsString(java.).
Upvotes: 1