eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.2k stars 867 forks source link

Is it possible to change environment variables on runtime? #1074

Open landoephan opened 1 year ago

landoephan commented 1 year ago

Do you want to request a feature or report a bug? Feature request

What is the current behavior? It is possible to configure environmentVariables to override a .env file with env variables on build time. So when I configure this:

<configuration>
    <installDirectory>node_target</installDirectory>
    <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
    <nodeVersion>v18.14.2</nodeVersion>
    <environmentVariables>
        <MY_VARIABLE>${env.CUSTOM_VARIABLE}</MY_VARIABLE>
    </environmentVariables>
</configuration>

and run

export CUSTOM_VARIABLE=someValue
mvn clean install

the value for MY_VARIABLE is set to someValue.

Is there any way to change that value without rebuilding the application? for example in a docker container or kubernetes cluster?

Please mention your frontend-maven-plugin and operating system version. frontend-maven-plugin: 1.12.1 OS: macOS Ventura 13.2.1