我们正在实施一个从Jenkins的ANT脚本调用AppManage TIBCO命令的解决方案。 Jenkins负责从SVN下载源代码,然后执行Ant脚本。下面是build.xml的片段以及从Jenkins调用时收到的错误。
错误:
build [bin] $ cmd.exe /C "E:\apache-ant-1.9.7\bin\ant.bat -file build.xml
-D=DEVENV -DVersion=tag3 -DDEVNAM="" && exit %%ERRORLEVEL%%"
The parameter is incorrect
ERROR: command execution failed.
剧本:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="tibco_test_client" basedir="." default="deploy.tibco">
<property name="projectName" value="tibco_test_client"/>
<property name="ear.dir" value="E:\CI\workspace\ear"/>
<property name="App.dir" value="TestApache/${projectName}"/>
<property name="jar.dir" value="../lib"/>
<property name="tibco.tra.home" value="E:\esb\profile\ESB_SRV_01\1.1\product\tibco\tra\5.8\bin"/>
<property name="tibco.AppManage.path" value="E:\esb\profile\ESB_SRV_01\1.1\product\tibco\tra\5.8\bin\AppManage.exe"/>
<property name="tibco.domain" value="NAM_DEV_01"/>
<property name="tibco.user" value="namdev_admin"/>
<property name="tibco.password" value="NAMDev01"/>
<property name="Updated.xml.Path" value="E:\CI\workspace\${projectName}.xml"/>
<property name="propertyFile.Name" value="E:\CI\workspace\tibco_test_client.properties"/>
<target name="clean.tibco" description="Delete all generated ear files">
<delete dir="${ear.dir}" failonerror="false"/>
<mkdir dir="${ear.dir}"/>
</target>
<target name="compile.tibco" depends="clean.tibco" description="Compiles BusinessWorks projects">
<taskdef name="tibbwBuildEar" classname="org.apache.tools.ant.taskdefs.optional.tibco.TibbwBuildEar" classpath="${jar.dir}/ant-tibco.jar"/>
<tibbwBuildEar srcdir="E:\CI\workspace\${projectName}" destdir="${ear.dir}" bindir="${tibco.tra.home}">
</tibbwBuildEar>
</target>
<target name="config.tibco" depends="compile.tibco" description="Extracts the config file of BusinessWorks projects">
<taskdef name="tibbwExportConfig" classname="org.apache.tools.ant.taskdefs.optional.tibco.TibbwExportConfig" classpath="${jar.dir}/ant-tibco.jar"/>
<tibbwExportConfig srcdir="${ear.dir}" destdir="${ear.dir}" bindir="${tibco.tra.home}">
</tibbwExportConfig>
</target>
<target name="init" depends="config.tibco">
<property file="${propertyFile.Name}"/>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
</target>
<target name="UpdateXML" description="update the generated XML configuration values based on Property file values " depends="init">
<property file="${propertyFile.Name}" prefix="x"/>
<local name="propertyList"/>
<propertyselector property="propertyList" delimiter="," select="\1" match="x\.([^\.]*)\.xpath" casesensitive="true" distinct="true"/>
<for list="${propertyList}" param="sequence">
<sequential>
<echo> @{sequence} </echo>
<echo> @{sequence}.xpath = ${x.@{sequence}.xpath} </echo>
<echo> @{sequence}.value = ${x.@{sequence}.value} </echo>
<xmltask dest="${Updated.xml.Path}">
<fileset file="${Updated.xml.Path}"/>
<replace
path="${x.@{sequence}.xpath}"
withText="${x.@{sequence}.value}"/>
</xmltask>
</sequential>
</for>
</target>
<target name="deploy.tibco" depends="UpdateXML" description="Deploys the BusinessWorks ears">
<taskdef name="tibbwDeploy" classname="org.apache.tools.ant.taskdefs.optional.tibco.TibbwDeploy" classpath="${jar.dir}/ant-tibco.jar"/>
<tibbwDeploy srcdir="${ear.dir}" bindir="${tibco.tra.home}" domain="${tibco.domain}" user="namdev_admin" password="NAMDev01">
</tibbwDeploy>
</target>
<!--<target name="undeploy.tibco" depends="deploy.tibco" description="Undeploys the BusinessWorks ears">
<taskdef name="tibbwUndeploy" classname="org.apache.tools.ant.taskdefs.optional.tibco.TibbwUndeploy" classpath="${jar.dir}/ant-tibco.jar"/>
<tibbwUndeploy srcdir="${ear.dir}" bindir="${tibco.tra.home}" domain="${tibco.domain}" user="namdev_admin" password="NAMDev01">
</tibbwUndeploy>
</target>
<target name="delete.tibco" depends="undeploy.tibco" description="Deletes the BusinessWorks ears">
<taskdef name="tibbwDelete" classname="org.apache.tools.ant.taskdefs.optional.tibco.TibbwDelete" classpath="${jar.dir}/ant-tibco.jar"/>
<tibbwDelete srcdir="${ear.dir}" bindir="${tibco.tra.home}" domain="${tibco.domain}" user="namdev_admin" password="NAMDev01">
</tibbwDelete>
</target> -->
</project>