Currently I am using a .sh script that is called from my main ANT script to execute "setWLSEnv.sh". So the configuration looks like this:
[ANT build.xml]
<project name="Automation" default="start" basedir=".">
<target name="start">
<exec executable="run_setWLSEnv.sh" resolveexecutable="true">
<arg value="/usr/local/bea/wlserver_10.3/server/bin" />
<arg value="setWLSEnv.sh" />
</exec>
</target>
</target>
[SH script]
echo "Now setting up the CLASSPATH and PATH for WebLogic..."
cd ${1}
. ./${2}
echo "All set."
I know I can run the "setWLSEnv.sh" script directly from ANT (and I've done it), but doing this does not set my PATH and CLASSPATH env variables for my ANT session and when I try to start WebLogic it just fails. The solution with ". ./" was suggested by someone, and it's working if I am running manually (so, before the ANT script just run from the command line the command: ". ./setWLSEnv.sh"). But, when I am running this command from my sh file, the CLASSPATH and PATH variables are not set in my ANT session.... so, same as before, WebLogic doesn't start.
The workaround I found is to set the CLASSPAT in a build.properties file and just use the property in my ANT script, in the "wlserver" task as the value for "classpath" argument. But this is just a temporary solution... an not very platform independent because I have hardcoded paths (currently working on Solaris, and if I move to Linux, the WL CLASSPATH is's proppably changed...).
So again... is there any way to have a build.xml file that STARTS WebLogic using "wlserver" task without the user having to run manually other external scripts and without hardcoding the CLASSPATH in the property file? I just want the script to be easy to use, generic, portable... just copy it to a machine that has the WebLogic installed, set the correct WL_HOME... and run it without any problems

.