pass a java parameter from maven

前端 未结 3 1623
醉梦人生
醉梦人生 2020-12-06 02:53

I need to execute some tests with maven, and pass a parameter from the command line.

My java code should get the parameter as: System.getenv(\"my_parameter1\");

3条回答
  •  难免孤独
    2020-12-06 03:17

    The maven surefire plugin also has an option to set environment variables, just add this to your plugin configuration.

    
        value
    
    

    I think this requires that the plugin operates in fork mode, which is the default.

提交回复
热议问题