Pass system property in a Gradle Task

If you created a Micronaut App with Gradle (the default build tool) used by Micronaut CLI, you may want to start your app in a particular Micronaut environment. You can supply an environment with the system property micronaut.environments. Modify your build.gradle file

run {
systemProperty "micronaut.environments", System.getProperty('micronaut.environments')

Then you can start the app with:

$ ./gradlew -Dmicronaut.environments=dev run

Tags: #gradle #spock #geb #grails #groovy #java #wordpress #woocommerce #micronaut
Mar 2019, 25.


My next events:
🗓 Jul 20 09:00 Workshop Security in the Micronaut Framework
🗓 Sep 20 09:00 JCON Online 2022 - Getting Started with the Micronaut Framework
🗓 Sep 23 09:00 JCON Online 2022 - Micronaut® Framework and Microstream Java-native persistence engine