Sunday 19 November 2017

SOA 12c - How to setup Maven for your SOA project

In this article we will take you through the steps so that you can use Maven to build your project outside SOA Suite. You can create build and deploy directly from SOA Suite, but what about when someone gives you a SOA project and you just want to build and deploy. Do you really need to open up SOA Suite in this case? No right. Now any SOA project will have a default pom file but you cannot compile or package using maven directly as the sar packaging and all oracle libraries are not available in Maven repo. So you have to install all libraries in your local repo and update the archetype. S lets take a look at tge steps



Step 1 :
Install all libraries in local library by syncing
Navigate to %MW_HOME%\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3 and use following commands to sync your local repository:
mvn install:install-file -Dfile=oracle-maven-sync-12.1.3.jar -DpomFile=oracle-maven-sync-12.1.3.pom
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=%MW_HOME%

Step 2 :
Update your archetype catalog

mvn archetype:crawl -Dcatalog=C:\Users\<<uname>>\.m2\archetype-catalog.xml

Step 3 :
You can create build and deploy SOA application from command line using maven

Create new application

mvn archetype:generate -DarchetypeGroupId=com.oracle.soa.archetype -DarchetypeArtifactId=oracle-soa-application -DarchetypeVersion=12.1.3-0-0 -DgroupId=com.innova.test -DartifactId=test-soa-application -DprojectName=test-soa-project -Dversion=1.0-SNAPSHOT

Build an existing application
mvn compile




No comments:

Post a Comment