Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ANT构建在WS_ANT中运行良好,但在RAD中失败_Ant_Websphere_Websphere 7_Ibm Rational - Fatal编程技术网

ANT构建在WS_ANT中运行良好,但在RAD中失败

ANT构建在WS_ANT中运行良好,但在RAD中失败,ant,websphere,websphere-7,ibm-rational,Ant,Websphere,Websphere 7,Ibm Rational,只是尝试运行IBM RAD\RSA 8中的ANT脚本以部署到websphere。 当使用WS_ANT.bat从命令提示符运行时,它可以正常工作,但RAD内部会出现以下错误 Unable to determine WAS Home directory. Please use the wasHome task attribute or set the was.root System property. 下面是从SO复制并再次修改的基本ANT脚本,在WS_ANT中运行良好,但在RAD中运行不好 &l

只是尝试运行IBM RAD\RSA 8中的ANT脚本以部署到websphere。 当使用WS_ANT.bat从命令提示符运行时,它可以正常工作,但RAD内部会出现以下错误

Unable to determine WAS Home directory. Please use the wasHome task attribute or set the was.root System property.
下面是从SO复制并再次修改的基本ANT脚本,在WS_ANT中运行良好,但在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">
                        <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>
如果查看ws_ant.bat文件,您会发现它首先调用setupCmdLine.bat来设置命令行。该文件试图通过将WAS_HOME环境变量设置为父目录来确定该变量

SET CUR_DIR=%cd%
cd /d "%~dp0.."
SET WAS_HOME=%cd%
cd /d "%CUR_DIR%"
从命令行运行时,这很好。您通常位于~/SDP/runtimes/base_v7/bin或其他服务器版本目录中。父母就是你想去的地方

在运行ws_ant.bat脚本时,我将研究如何设置工作目录。这可能是最有可能的原因