How to pass a reference to distribution home directory using application plugin?

Hi. I’m using application plugin and I want to create distribution which contains ‘conf’ directory inside app home folder. This dir should contain several configuration files. e.g. java.util.logging properties, etc. To point JUL my configuration file I should pass jvm property -Djava.util.logging.config=… and here I need a reference to app installation directory. It seems that scripts set this path into APP_HOME variable. But there is a problem: I cannot pass into defaultJvmOpts property something like ‘$APP_HOME’ since there are two kinds of scripts (win and nix) and moreover dollar sign is unconditionally escaped.

So, is there any way to pass a reference to app home directory as a virtual machine argument?

Thanks!

You’ll have to augment the start scripts.

There’s an example of this here: https://github.com/ratpack/ratpack/blob/master/ratpack-gradle/src/main/groovy/ratpack/gradle/RatpackPlugin.groovy#L93

In Mojo Appassembler Plugin (Maven) generated scripts add app.home as a Java System Property. app.home references to runtime “installation” directory (the one that contains /bin and /lib).

See http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/usage-script.html

It could be very useful to have this Property inside the running application.