简体   繁体   English

如何使用Ant将portlet部署到远程WebSphere Portal?

[英]How to deploy with Ant an portlet to remote WebSphere Portal?

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

You should be able to do this with the XmlAccess Ant tasks. 您应该能够使用XmlAccess Ant任务执行此操作。 See the appendices of the Redbook WebSphere Portal Version 6 Enterprise Scale Deployment Best Practices . 请参阅Redbook WebSphere Portal V6企业规模部署最佳实践的附录。

We do this, locally, not remotely, with an ant task that does the following: 我们使用执行以下操作的ant任务在本地而不是远程执行此操作:

1) copy's the portlet war file to the Portal's installApps directory (since you are doing it remote, you would need to FTP it or something, rather than simply copy it locally as we do). 1)将portlet war文件复制到Portal的installApps目录(因为你正在远程执行它,你需要FTP或其他东西,而不是简单地在本地复制它)。

2) Executes the xmlaccess script (in our case, xmlaccess.bat, in your case xmlaccess.sh) against a xml access file called "update.xmlaccess" in a subdirectory of the current directory called "xmlaccess". 2)对名为“xmlaccess”的当前目录的子目录中名为“update.xmlaccess”的xml访问文件执行xmlaccess脚本(在我们的示例中为xmlaccess.bat,在您的情况下为xmlaccess.sh)。

Here is a clip of the code from our ant task. 这是我们的ant任务代码的剪辑。 Some of the values in there are variables specific to our script, but the names should be simple enough to figure out what they do: 其中的一些值是特定于我们脚本的变量,但名称应该足够简单,以弄清楚它们的作用:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM