开发者

ANT build runs fine with WS_ANT but fails in RAD

Just trying to run ANT script with in IBM RAD\RSA 8 to deploy to websphere . It works fine when run from command prompt using WS_ANT.bat but inside RAD fails with following error

Unable to determine WAS Home directory. Please use the wasHome task attribute or set the was.root System property.

Following is basic ANT script copied from SO and Modified again runs fine from WS_ANT but not from RAD

<?xml version="1.0"?>
<projectname="project"default="wasListApps"basedir=".">
        <description>
        Script for listing installed apps.
        Example run from:
        /opt/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/bin
    </description>

        <propertyname="was_home"location="C:\Program Files\ibm\SDP80\runtimes\base_v7"/>       

        <pathid="was.runtime">
                <filesetdir="${was_home}/lib">
                 开发者_如何学Go       <includename="**/*.jar"/>
                </fileset>
                <filesetdir="${was_home}/plugins">
                        <includename="**/*.jar"/>
                </fileset>
        </path>
        <propertyname="was_cp"value="${toString:was.runtime}">
        </property>
        <propertyname="was_server"value="server1"/>
        <propertyenvironment="env">
        </property>

        <targetname="wsStopServer">
                <taskdefname="wsStopServer"classname="com.ibm.websphere.ant.tasks.StopServer"classpath="${was_cp}">
                </taskdef>
                <wsStopServerserver="${was_server}"failonerror="false"/>
        </target>

        <targetname="wsStartServer" depends="wsStopServer">
                        <taskdefname="wsStartServer"classname="com.ibm.websphere.ant.tasks.StartServer"classpath="${was_cp}">
                        </taskdef>
                        <wsStartServerserver="${was_server}"failonerror="true"/>
                </target>


        <targetname="wasListApps"depends="wsStartServer">
                <taskdefname="wsListApp"classname="com.ibm.websphere.ant.tasks.ListApplications"classpath="${was_cp}">
                </taskdef>
                <wsListAppwasHome="${was_home}"/>
        </target>

</project>


If you look at the ws_ant.bat file you will find it calls the setupCmdLine.bat first thing to, you guessed it, setup the command line. That file tries to determine the WAS_HOME environment variable by setting it to the parent directory.

SET CUR_DIR=%cd%
cd /d "%~dp0.."
SET WAS_HOME=%cd%
cd /d "%CUR_DIR%"

This is fine when you run from the command line. You are usually in the ~/SDP/runtimes/base_v7/bin (or other server version) directory. The parent is where you want to be.

I would look into setting the working directory when you run the ws_ant.bat script. That is probably the most likely cause.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜