如何获取或读取pom.xml中'systemPropertyVariables'标签下定义的Env变量?

How to get or read the Env variable defined under 'systemPropertyVariables' tag in pom.xml?

如何获取或读取pom.xml中'systemPropertyVariables'标签下定义的Env变量?看看 pom.xml 片段。我想获取 'env' 的值并在我的代码中使用它。

<systemPropertyVariables>
        <propertyName>${env}</propertyName>
</systemPropertyVariables>

如评论中所述,您可以使用

System.getProperty("propertyName") 

谢谢