How do you get the path of the running script in groovy?

后端 未结 6 1706
悲哀的现实
悲哀的现实 2020-12-02 11:54

I\'m writing a groovy script that I want to be controlled via a properties file stored in the same folder. However, I want to be able to call this script from anywhere. Wh

6条回答
  •  情深已故
    2020-12-02 12:25

    workaround: for us it was running in an ANT environment and storing some location parent (knowing the subpath) in the Java environment properties (System.setProperty( "dirAncestor", "/foo" )) we could access the dir ancestor via Groovy's properties.get('dirAncestor').
    maybe this will help for some scenarios mentioned here.

提交回复
热议问题