Environmental variables in ant script not working

后端 未结 3 1995
灰色年华
灰色年华 2021-02-05 18:06

I\'m trying to set up a machine-independent build environment for a Spring framework project, and my ant configuration appears to be not working. I\'ve searched quite a bit but

3条回答
  •  感情败类
    2021-02-05 18:18

    Add the following line to the build.xml file:

    
    

    to define the prefix when referencing environment variables. From the Property reference page for the environment attribute:

    the prefix to use when retrieving environment variables. Thus if you specify environment="myenv" you will be able to access OS-specific environment variables via property names "myenv.PATH" or "myenv.TERM". Note that if you supply a property name with a final "." it will not be doubled; i.e. environment="myenv." will still allow access of environment variables through "myenv.PATH" and "myenv.TERM". This functionality is currently only implemented on select platforms. Feel free to send patches to increase the number of platforms on which this functionality is supported ;). Note also that properties are case-sensitive, even if the environment variables on your operating system are not; e.g. Windows 2000's system path variable is set to an Ant property named "env.Path" rather than "env.PATH".

提交回复
热议问题