Search This Blog

Wednesday, July 11, 2012

SOA 11g using ant scripts to deploy and undeploy

 

1. First Set JAVA_HOME

set JAVA_HOME=D:\fmw1115\Middleware\jdk160_24

2. set PATH=D:\fmw1115\Middleware\modules\org.apache.ant_1.7.1\bin;%PATH%
3. cd D:\fmw1115\Middleware\jdeveloper\bin

4. Note the down the directory where your SOA Project is there 

D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\HelloSOA

5. Compile and package the soa project

ant -f ant-sca-package.xml -DcompositeDir=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\HelloSOA  -DcompositeName=HelloSOA  -Drevision=1.0  -Dscac.application.home=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest
6. Deploy the SOA Project
ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001  -DsarLocation=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\HelloSOA\deploy\sca_HelloSOA_rev1.0.jar  -Doverwrite=true  -Duser=weblogic  -Dpassword=xxxxx
7. To undeploy use the following command ,
ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001    -Duser=weblogic  -Dpassword=xxxx  -DcompositeName=BR_FndIntg_SimpleRuleIVP -Drevision=6.18 undeploy

 

Using this batch script , you can deploy the same composite with say 100 revisions

----------------
@REM initialize test value to be "true"
@SET intCounter=1
:while
@REM test condition
@IF %intCounter% GTR 100 (GOTO wend)
@REM procedure where condition is "true"
@echo ==============================================================================================================
@echo %intCounter%
Rem call ant -f ant-sca-package.xml -DcompositeDir=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\SimpleRule  -DcompositeName=SimpleRule  -Drevision=%intCounter%.0  -Dscac.application.home=D:\bugs-download
\Bug14258512\RuleAPITest\RuleAPITest
Rem call ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001  -DsarLocation=D:\bugs-download\Bug14258512\RuleAPITest\RuleAPITest\SimpleRule\deploy\sca_SimpleRule_rev%intCounter%.0.jar  -Doverwrite=true  -
Duser=weblogic  -Dpassword=xxxxxx
call ant -f ant-sca-deploy.xml  -DserverURL=http://localhost:7001    -Duser=weblogic  -Dpassword=xxxxx-DcompositeName=SimpleRule  -Drevision=%intCounter%.0 undeploy
@REM set new test value
@SET /a intCounter=intCounter+1
@REM loop
@echo ==============================================================================================================
@GOTO while
:wend

-----------------

3 comments:

Unknown said...

Hi,
I tried these commands but got success only in building the composite. In deploy command, it gave connection error(code-404). I did it successfully using JDev. Can anyone please suggest?

Thanks in advance.

Unknown said...

Hi ranjit,
server url http://localhost:7001 is wrong,it is actually http://localhost:8001

Unknown said...

Hi,
Thanks for your post.
I would like to know more about how to build an application with 2 projects. I have one like that; one project is BPEL which will be built to jar file and another one is a task form for human task in BPEL project. So how to build the first to Project_name.jar file and the second to Application_name.ear. When I use jdeveloper to build this application, I get 2 those files.
So I would like to build 2 those files by using ant. Could you please guide me to do that.
Thank you!