IBM provides ant task called XmlAccess. My goal is to achieve the invokation of configuration tasks on remote machine from my machine. I use Windows 7 and ant 1.8.4 . Remote installations of WebSphere Portal use Linux.
Here are the steps to use XmlAccess ant task on remote machines.
From the remote WebSphere portal copy:
- /base/wp.xml.client/bin/wp.xml.client.jar
- /base/wp.base/shared/app/wp.base.jar
Next, create build.xml with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Invoke" basedir="." default="export">
<taskdef name="xmlaccess" classname="com.ibm.wps.xmlaccess.XmlAccessTask" classpath="wp.xml.client.jar;wp.base.jar"/>
<property name="targetPortalUser" value="${admin}"/>
<property name="targetPortalPwd" value="${password}"/>
<property name="targetPortalUrl" value="${remoteHost}:${remotePort}/wps/config"/>
<target name="export">
<xmlaccess
user="${targetPortalUser}"
password="${targetPortalPwd}"
url="${targetPortalUrl}"
srcfile="ExportAllPortlets.xml"
destfile="ExportAllPortlets.xml.target.xml" />
</target>
</project>
Here we define the XmlAccessTask with taskdef tag.
Next, we invoke xmlaccess task with the given sourcefile and output file.
After that you can invoke ant and ExportAllPortlets.xml.target.xml will appear in folder.
XmlAccessTask has the following options:
srcfile
destfile
url
user
password
trustStore
trustStorePassword
trustStoreType
failonerror
Комментариев нет:
Отправить комментарий