How to set up an environment variable in mvn pom?

后端 未结 2 1243
孤城傲影
孤城傲影 2021-01-03 21:11

How can i set up an environment variable (in other words internally accessible by System.getenv(\"APP_HOME\") in a pom file?

APP_HOME=/path/home         


        
2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-03 21:29

    Some plugins, like surefire, let you set them. There's no way, in general, in the pom.

    The doc for surefire is is here. Surefire will set environment variables for the duration of the run of the tests, not for anything else. And you have to make surefire fork.

    In the configuration ...

    
      always
      
         val1
      
    
    

提交回复
热议问题