|
From: Leif M. <le...@ta...> - 2003-03-13 16:00:49
|
Mike Castle wrote: >1) Not all .jar files are in the same directory. >2) Not every .jar file in a directory should be in the startup classpath. > >I'm a firm believer in explicitly enumerating everything. > You convinced me. I went ahead and got this implemented. Thanks for your patch. I did things a little differently do keep the property code simple. Here is the text from the new documentation: --- Environment Variable Definition The Wrapper supports the ability to define environment variables from within the wrapper.conf file or from the command line. Once defined, the environment variable can be referenced like any other environment variable. This includes use in variable expansion as described above. Environment variables are defined by using special property names which begin with "set." followed by the name of the environment variable. The value of the property will be the value of the new environment variable. set.EXTERN_APP=C:/ExternAppHome The ability to define environment variables make it possible to easily modify values that may be used throughout a configuration file. The example below shows how an environment variable can be used to specify the location of an external application. set.EXTERN_APP=C:/ExternAppHome wrapper.java.classpath.1=../lib/wrapper.jar wrapper.java.classpath.2=%EXTERN_APP%/lib/jar1.jar wrapper.java.classpath.3=%EXTERN_APP%/lib/jar2.jar wrapper.java.classpath.4=%EXTERN_APP%/lib/ext/jar3.jar wrapper.java.classpath.5=%EXTERN_APP%/lib/ext/jar4.jar The use of environment variables definitions can be very powerful if you understand how and when their values are set. Environment variables which were set before the Wrapper is launched can of course be used as usual. If the same variable name is specified in the configuration file then the value in the configuration file will override the existing value. Environment variables defined from the command line work a little differently. These values will override any values from either the system or those set in the configuration file. This makes it possible to define default environment variables within the wrapper.conf file and then override that value from the command line. Windows: Wrapper.exe -c ..\conf\wrapper.conf "set.EXTERN_APP=C:\Program Files\ExternAppHome" Unix: wrapper ../conf/wrapper.conf set.EXTERN_APP=/usr/lib/externapphome Notice that like all properties set from the command line, properties which include spaces can be defined by including the entire property name, value pair in quotes. --- >>:startup >>"%_APP_HOME%\bin\Wrapper.exe" -c %_WRAPPER_CONF% >>wrapper.java.classpath.2=%_MYAPP_HOME%/lib/*.jar >> >> >Took me a while to figure out that had gotten word wrapped. :-/ > Sorry about that. :-) This is all checked into CVS and lightly tested on both Linux and Windows. So feel free to check it out and give it a try. Cheers, Leif |