Showing posts with label build.properties. Show all posts
Showing posts with label build.properties. Show all posts

Friday, 6 October 2017

ANT : SOA 11g/12c MDS Deployment

This is what you should do to setup ANT for SOA MDS deployment.

Prerequisites:

1. Create folder ANT
2. Inside create a folder deploy
3. Set up your ANT_HOME environment variable
4. Execute command ant, to check if ant is setup correctly

Steps:

Goto ANT folder
1. Create file build.properties like below:

mds.repository=E:\JDeveloper\soamds
oracle.home=E:\Oracle\Middleware\Oracle_Home
deploy.serverURL=http://localhost:7004
deploy.user=weblogic
deploy.password=welcome1

Update values as per your machine/server.

2. Create build.xml like below:

<?xml version="1.0" encoding="UTF-8"?>
<!--
   Deployment Script for MDS
   Author : Nadim Warsi
-->

<project name="deployMDS" default="deployMDS">
  <property file="build.properties"/>
  <target name="deployMDS">

    <echo>Deploy MDS</echo>
    <echo>Remove and create local MDS temp folder</echo>
    <delete dir="deploy"/>
    <mkdir dir="deploy"/>
    <zip destfile="deploy/mds.jar" compress="false">
      <fileset dir="${mds.repository}/apps"/>
    </zip>   
    <ant antfile="${oracle.home}/soa/bin/ant-sca-deploy.xml" inheritall="false" target="deploy">
      <property name="wl_home"
value="${oracle.home}/wlserver"/>
      <property
name="oracle.home" value="${oracle.home}/soa"/>
      <property
name="serverURL" value="${deploy.serverURL}"/>
      <property
name="user" value="${deploy.user}"/>
      <property
name="password" value="${deploy.password}"/>
      <property
name="overwrite" value="true"/>
      <property
name="forceDefault" value="true"/>
      <property
name="sarLocation" value="deploy/mds.jar"/>
      <property
name="failOnError" value="true"/>
    </ant>

    <echo>MDS deployment completed</echo> 
  </target>
</project>


3. Save all
4. Execute command: ant
5. Check your MDS in JDeveloper.


Helpful? Please Comment.

Happy Learning!!





Sunday, 24 September 2017

ANT : SVN checkout

Steps on how to setup and checkout SVN code using Ant

1. Create a folder AntCheckout
2. Inside it create a folder lib
3. Download the below list of jars and place them in the lib folder




4. Inside Ant folder create build.properties file which should look like below:

svn.url=http://svn.test.com/svn/repos/myproject
svn.revision=HEAD
svn.uname=test

svn.password=test
svn.checkout.dir=myrepo

5. Update the property values accordingly with your SVN details.

6. Inside Ant folder create build.xml which should look like below:

<?xml version="1.0" encoding="iso-8859-1"?>
<project name="svncheckout" default="checkout">

    <!-- Antcontrib path -->
    <path id="antcontrib.path">
      <pathelement path="lib/ant-contrib-1.0b3.jar" />
    </path>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antcontrib.properties"/>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antlib.xml"/>
   
    <!-- SVNANT path -->
    <path id="svn.ant.classpath">
        <fileset dir="lib">
        <include name="**/*.jar"/>
        </fileset>
    </path>      
    <taskdef classpathref="svn.ant.classpath" resource="org/tigris/subversion/svnant/svnantlib.xml"/>

    <!-- SVN Checkout -->
    <svnSetting svnkit="true" javahl="false"  id="svn.settings"/>
    <target name="checkout" description="Pulls code from Subversion into the directory" depends="init">
            <echo>SVN URL: ${svn.url}</echo>
            <echo>Revision: ${svn.revision}</echo>
            <echo>Target Dir: ${svn.checkout.dir}</echo>
            <svn refid="svn.settings" username="${svn.uname}" password="${svn.password}" >
              <checkout url="${svn.url}" destPath="${basedir}/${svn.checkout.dir}" revision="${svn.revision}"/>
            </svn>  

             <!-- Remove unwanted .svn folders --> 
            <delete includeEmptyDirs="true">
                <fileset dir="${svn.checkout.dir}" includes="**/.svn/" defaultexcludes="false"/>
            </delete>
    </target>

    <!-- Clean folder before checkout -->
    <target name="init">
    <echo>Cleaning checkout folder: svn</echo>
        <delete includeemptydirs="true">
            <fileset dir="svn" includes="**/*"/>
        </delete>
        <mkdir dir="${svn.checkout.dir}"/>
    </target>
</project>

     <!-- Check if build.properties is available -->
    <available file="build.properties" property="file.exists" value="true" />
    <fail unless="file.exists" message="ERROR: Filename 'build.properties' does not exist." />
    <property file="build.properties"/>
 

7. Save All
8. Open command-prompt/ putty and set your ANT HOME
9. Run command ant checkout
10. The required artifacts will be checked-out in the myrepo folder.


Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...