How do you run micronaut from gradle with local properties

Aziris

I want to run Micronaut server from Gradle command line with "local" environment variables. The regular command

.\gradlew.bat run

will use default variables defined in application.yml file. I want to override some of them with values for my local environment and therefore need to specify system property micronaut.environments=local to use overriding values from application-local.yml file.

.\gradlew.bat run -Dmicronaut.environments=local

The command above won't work as Gradle will take only -Dmicronaut for the system property and the rest ".environments=local" will be considered as another task name:

Task '.environments=local' not found in root project 'abc'

What would be the correct way to pass such system property to the java process?

tsarenkotxt

Command below works for unix, probably it should work also for windows:

MICRONAUT_ENVIRONMENTS=local gradle run

or use gradle wrapper

MICRONAUT_ENVIRONMENTS=local .\gradlew.bat run

P.S. also, you can find the same approach for Spring Boot

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I read Micronaut array properties from the root of the configuration hierarchy?

Routing. How do you transfer properties?

Do You Cache Properties in Local Variables?

How do you escape colon (:) in Properties file?

How do you add a "system" dependency in Gradle?

How do I access the ApplicationContext from a service within the micronaut framework?

How do you run multiple programs in parallel from a bash script?

How to run gradle script from gradle

How do you run tests from the command line?

How Do You Run Webpack from a JavaScript file?

How do you activate a virtual environment from Gradle?

How do I read application properties in Micronaut?

How do you add local .jar file dependency to build.gradle.kt file?

How do you load videos from a local folder

How do you run cpack from visual studio?

How do you run pytest or flask8 from powershell?

Micronaut: How do I map all the properties values in HashMap?

How do you run batch files from Powershell?

How can you override an existing Gradle plugin from a local repository?

How do you update the properties of an object in javascript?

How to run Gradle JAR against local dependencies?

How do you set up gsutil to be run from the command line

How do you use UIView with properties or variables inherited from ViewController?

Rails 4: How do you run a Postgres database downloaded from Heroku on my local machine?

How do you run functions and variables from shell script into docker?

PYTHON: How do you run your programs from the terminal?

Do You Need The Gradle Sonar Plugin To Run SonarQube From Bamboo?

How do you access gradle.ext properties in Plugin Java source code?

How do you run pyenv commands from an npm script?