4

如何使用 Ant 将 portlet 部署到远程 WebSphere Portal 6.0 (Linux)?

4

2 回答 2

2

您应该能够使用 XmlAccess Ant 任务来执行此操作。请参阅 Redbook WebSphere Portal Version 6 Enterprise Scale Deployment Best Practices的附录。

于 2009-03-26T11:01:29.213 回答
2

我们通过执行以下操作的 ant 任务在本地而不是远程执行此操作:

1) 将portlet 的war 文件复制到Portal 的installApps 目录(因为您是在远程进行的,所以您需要通过FTP 或者其他方式,而不是像我们那样简单地在本地复制它)。

2) 针对当前目录“xmlaccess”的子目录中名为“update.xmlaccess”的 xml 访问文件执行 xmlaccess 脚本(在我们的示例中为 xmlaccess.bat,在您的示例中为 xmlaccess.sh)。

这是来自我们的 ant 任务的代码片段。其中的一些值是特定于我们脚本的变量,但名称应该足够简单,以便弄清楚它们的作用:

<target name="deploy" depends="war" description="deploy the application">
        <copy file="${project.base}/target/${package.name}.war" todir="${portal.base}/installableApps" />
        <echo message="Deploying ${project.name} to WebSphere Portal." />
        <exec executable="${portal.base}/bin/xmlaccess.bat">
            <arg line='-in "xmlaccess/update.xmlaccess" -user ${wps.admin.user} -pwd ${wps.admin.password} -url ${wps.admin.url} 
                -out "xmlaccess/deploymentresults.xmlaccess"' />
        </exec>
</target>
于 2009-04-06T19:58:26.440 回答