如何使用Ant将Portlet部署到远程WebSphere Portal?
答
您应该可以使用XmlAccess Ant任务完成此任务。请参阅红皮书WebSphere Portal Version 6 Enterprise Scale Deployment Best Practices的附录。
答
我们做到这一点,在本地,而不是远程,与蚂蚁的任务,执行以下操作:
1)副本的portlet的war文件到门户网站的installApps目录(因为你是远程做它,你将需要通过FTP或其他方式,而不是像我们一样简单地在本地复制它)。
2)在名为“xmlaccess”的当前目录的子目录中,对xml访问文件“update.xmlaccess”执行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>
您能发布update.xmlaccess文件吗?我试图完成同样的事情 – 2012-08-09 18:42:16