When i try to run the following from windows command prompt, it is working fine.
ant Reports -f C:/EAR_XMLS/InfraCopy.xml "-Dsource=C:\Console" "-Ddestination=C:/INFRA" "-DAPP_NAME=TEST_FCJ"
How to run the same in build.xml (ANT)? I dont prefer EXEC option.
<ant antfile="C:/EAR_XMLS/InfraCopy.xml" target="Reports">
<property name="source" value="C:\Console"/>
<property name="destination" value="C:/INFRA"/>
<property name="APP_NAME" value="TEST_FCJ"/>
</ant>
See docs here for more details.
Related
I'm trying to automate build for my IBM Integration Bus applications. I'm using Jenkins and Ant to do this.
<?xml version="1.0"?>
<project name="project" default="run">
<target name="run" description="">
<property name="toolkit.home" value="C:\Program Files\IBM\IIB\10.0.0.10\server\bin" />
<property name="cmd.home" value="C:\Windows\System32" />
<property name="cmd.file" value="${cmd.home}\cmd.exe"/>
<property name="iib.cmd" value="C:\Program Files\IBM\IIB\10.0.0.10\iib.cmd"/>
<antcall target="build" />
</target>
<target name="build">
<exec executable="${cmd.file}">
<arg value="/k"/>
<arg value="${iib.cmd}"/>
</exec>
<exec executable="mqsilist" newenvironment="false"/>
</target>
</project>
The first exec will set up the IIB build environment. The next exec will list all the Integration nodes installed on the machine. When the script is run, the second exec throws an error. "System can't find the specified file".
When I run the above commands in Powershell or cmd they work fine.
F:\Ant>C:\Windows\System32\cmd.exe /k "C:\Program Files\IBM\IIB\10.0.0.10\iib.cmd"
F:\Ant>mqsilist
What I exactly mean to say is the build environment which the first exec sets is lost. I don't want ant to loose the build environment set by first exec. Tried using newenvironment="false". It didn't work.
Any help would be appreciated.
I'm having some trouble freeing component builds from JDeveloper Studio...
I have a reference to aia.jar set up in JDeveloper, which I can't seem to specify correctly on the Ant command line.
Here's my command line:
ant -f c:\...\jdeveloper\bin\ant-sca-package.xml
-D"compositeDir=c:/.../ProcessImpl"
-D"compositeName=ProcessImpl"
-D"revision=1.0"
-D"scac.application.home=c:/.../.adf"
Everything seems to go well at first, until it fails with: package oracle.apps.aia.core.eh.logging does not exist
Here is the solution, for the sake of anyone that has the same issue in future...
My aia.jar lived in jdeveloper/lib ...
I had tried the CLASS_PATH environment variable, the -lib <path> option on the ant command line, and even adding to the classpath property in ant-sca-compile.xml - none of which made any difference.
The aia.jar file apparently HAS to exist in the SCA-INF/lib subdirectory of the project being built. In the end I created a wrapper build.xml file that copies the required dependency to this location and then calls out to ant-sca-package.xml...
<target name="build">
<echo>Copy AIA.jar</echo>
<mkdir dir="${sca-inf.dir}/lib" />
<copy file="${aia.file}" todir="${sca-inf.dir}/lib"/>
<echo>Create Package</echo>
<ant antfile="${script.home}/ant-sca-package.xml" inheritAll="false" target="package">
<property name="compositeDir" value="${path}/${name}"/>
<property name="compositeName" value="${name}"/>
<property name="revision" value="${rev}"/>
<property name="sca.application.home" value="${adf.dir}"/>
<property name="scac.application.home" value="${adf.dir}"/>
</ant>
</target>
I am using apache ant 1.9.4. I have written build xml for starting apache tomcat server 7.0.42. But the server closes as soon it gets started. Also the build is showing successfull.
My build.xml is.,
<property name="build.dir" value="aar" />
<property name="deploy-location" value="D:\EIT SOFTWARES\apache-tomcat-7.0.42_aqar\webapps" />
<property name="catalina.home" value="D:\EIT SOFTWARES\apache-tomcat-7.0.42_aqar"/>
<property name="tomcat" value="${catalina.home}" />
<target name="start-tomcat">
<echo message="Starting tomcat">
</echo>
<exec executable="${catalina.home}\bin\startup.bat"></exec>
</echo>
</target>
What i am making wrong. Ant experts please help me.
I am trting to build Blackberry project and generate the cod file.
My environment is Windows 7 and the apache-ant version is 1.8.2.
I have encountered two problems and they all lead to failure.
The command I used to build is "ant -Dbuild_env=prod"
Below is part of the code in the build.xml file.
<property file="build.properties" />
<property environment="SystemVariable"/>
<!--<property name="jde.home" value="${SystemVariable.JDE_HOME}"/> -->
<property name="jde.home" value="E:\eclipse-blackberry\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components"/>
<property name="bb_sign_pwd" value="${SystemVariable.BB_SIGN_PWD}"/>
<property name="jde.sigtooljar" value="${jde.home}/bin/SignatureTool.jar"/>
First problem:
If I use the code
<property name="jde.home" value="${SystemVariable.JDE_HOME}"/>
to run the building,
the error(error 1) is
"jde home must be a directory",
but if I use the code
<property name="jde.home" value="E:\eclipse-blackberry\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components"/>
it works but still build failed.
I think may be the ant cannot find the enviromental varialbe although I set the enviromental varialbe "JDE_HOME" in the Windows to "E:\eclipse-blackberry\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components".
Second problem:
Use the code
<property name="jde.home" value="E:\eclipse-blackberry\plugins\net.rim.ejde.componentpack5.0.0_5.0.0.25\components"/>
instead but another error(error 2) is
"XXX\XXX\XXX\build.xml:49:Java returned: -1"
Line 48 to 50 in the build.xml is like this
48:<target name="build" description="Builds Project" depends="init"/>
49:<rapc jdehome="${jde.home}" jdkhome="${SystemVariable.JAVA_HOME}" destdir="${output.dir}" output="${app.name}_${build_env}" quiet="false" generatesourcelist="true"/>
50:<jdp title="${app.title}" type="cldc" vendor="XXX Inc." version="${app.version}" description="XXX Application" icon="${icon.path}" focusicon="true" startuptier="7" ribbonposition="0"/>
Is there any one can help and tell me why there is error 1 and error 2?
Thanks.
I am using this script to launch WTP test
<ant target="ui-test" antfile="${eclipse-test-library-file}" dir="${eclipse-test-home}">
<property name="product" value="${productName}" />
<property name="application" value="${applicationName}" />
<property name="os" value="${baseos}"/>
<property name="ws" value="${basews}"/>
<property name="arch" value="${basearch}"/>
<property name="data-dir" value="${eclipse-test-home}/junit-workspace -clean" />
<property name="plugin-name" value="${pluginName}" />
<property name="classname" value="${testClassName}" />
</ant>
The workbench launched but the test did not run. Am I missing something in the ant property?
It's hard to judge what's missing in your setup, but there is an example project for running WindowTester tests from an Ant script here:
http://code.google.com/p/windowtester/downloads/detail?name=WindowTester_AntExample_v1.0.zip
If the example works for you, it should be easy to compare it to your project and find out the difference.