Purpose:
Deployment through scripts that can be automated through the use of Maven for SOA. This document covers the process of installing maven. We also cover deploying,un-deploying multiple projects through JDeveloper and Command Prompt.
MAVEN:
Maven can be used to create project templates that can be used across multiple projects.
It is also useful to automate the deployment process.
Maven has robust functionality which can be implemented in various ways the purpose of this blog is just to give the user an overview of Maven.
Pre-Installation Steps:
Setup your environment variables: JAVA_HOME (This points to your JDK folder)
Include this at the end of the PATH-- Variable(%MW_HOME%\oracle_common\modules\org.apache.maven_3.0.5\bin)
Installing Maven:
As discussed earlier Maven can be used to automate your project creation and deployment. We have tested the use of this tool on version 12.1.3 through our Local server as well as with isolated instances of SOA servers.
Installation of Maven can be done through JDeveloper as well. We will be going through the way in which we can add the maven agent through command prompt.
- 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:
Example: In the case of my machine this path was –
%MW_HOME% -- C:\Oracle_OSI\Middleware\Oracle_Home\oracle_common
- Run:
mvn install:install-file -Dfile=oracle-maven-sync-12.1.3.jar -DpomFile=oracle-maven-sync-12.1.3.pom
- Run:
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=%MW_HOME%
Step 2 and 3 install the Maven agent locally and enable the plug in for use in Oracle SOA.
- Update your archetype catalog:
mvn archetype:crawl -Dcatalog=C:\Users\<<uname>>\.m2\archetype-catalog.xml
- To generate the SOA Application and Project use the command below from the same location. It will generate a project which you can import from JDeveloper:
mvn archetype:generate -DarchetypeGroupId=com.oracle.soa.archetype -DarchetypeArtifactId=oracle-soa-application -DarchetypeVersion=12.1.3-0-0 -DgroupId=org.my.test -DartifactId=test-soa-application -DprojectName=test-soa-project -Dversion=1.0-SNAPSHOT
How to create a Template from command prompt and deploy through the use of this Maven plugin:
So far what we have done enables the plug in for SOA and creates the project for using in SOA. Here we move to Jdeveloper to import the created application and work on the project. In Jdeveloper we will also work on editing the POM file to mention which server we will be deploying to.
- Import this maven project in JDeveloper using File –> Import and select the Maven Project option as shown below. Click OK.
- Select the location of the created project from Step 5 in the previous instructions.
Example: C:\Oracle_OSI\Middleware\Oracle_Home\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3\test-soa-application
- Select all the files listed in the Box below and import them into the project through the option available in the same window.
- Once the project is opened there will be 2 Pom.xml files that will be available: One in the Projects plane and one in the application server plane.
- The POM file in the project plane is crucial as it holds all the server information which includes the wls url and uid and pass of the instance.
- Now we move back to CMD prompt where we navigate to our local workspace and complie and deploy the project using mvn compile and mvn pre-integration-test
Example:
- This will deploy your application into WLS sever specified in the POM file. Note that this is an application level deployment.
Other commands that can be executed from CMD for Maven:
mvn com.oracle.soa.plugin:oracle-soa-plugin:compile
mvn com.oracle.soa.plugin:oracle-soa-plugin:sar
mvn com.oracle.soa.plugin:oracle-soa-plugin:deploy
mvn com.oracle.soa.plugin:oracle-soa-plugin:undeploy
mvn com.oracle.soa.plugin:oracle-soa-plugin:redeploy
Deploying Projects that have been created from JDeveloper instead of Command Prompt:
- Create your local project from the SOA application as you normally do.
- There will be at least 2 pom.xml files present in reach Application as explained above. 1 Pom file referees back to the Application while a new pom file is created for each project within the application.
- The POM file in the project plane needs to be updated with the URL and USER and PASSWORD as shown above in (4). This is in the properties plane inside the project pom file.
- Next is similar instructions to the commands shown before. Please run the commands in the order listed
mvn com.oracle.soa.plugin:oracle-soa-plugin:compile
mvn com.oracle.soa.plugin:oracle-soa-plugin:sar
mvn com.oracle.soa.plugin:oracle-soa-plugin:deploy
- You should see the text Build Successful for each command that is run.
- For un-deploying the same project through Maven. Please change the values in the build plane of the project pom file as shown below.
Run the following commands in the same order
mvn com.oracle.soa.plugin:oracle-soa-plugin:compile
mvn com.oracle.soa.plugin:oracle-soa-plugin:sar
mvn com.oracle.soa.plugin:oracle-soa-plugin:undeploy



Learned a lot of new things from your post!
ReplyDeleteOracle SOA Online Training
Facing a strange issue
ReplyDelete[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-0-0:deploy (default-deploy) on project TestProject: Execution default-deploy of goal com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-0-0:deploy failed: An API incompatibility was encountered while executing com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-0-0:deploy: java.lang.NoSuchMethodError: oracle.integration.platform.blocks.deploy.servlet.CompositeDeployerClient.setFolder(Ljava/lang/String;)V
[ERROR] -----------------------------------------------------
[ERROR] realm = extension>com.oracle.soa.plugin:oracle-soa-plugin:12.2.1-0-0
This is amazing and awesome,Thanks for sharing
ReplyDeleteOracle SOA Online Training
Lung cancer often goes unnoticed in its early stages. As the disease develops, a persistent cough develop and chronic cough worsen. include chest pain, shortness of breath, hoarseness, bloody fluid coughed up from the respiratory tract, and frequent bouts of bronchitis or pneumonia. Sometimes the first was bone pain, headaches, dizziness,I was so piss off and tired of my life until i read about Dr Itua herbal medicine on blogspot i really thought it was scam when i first contacted him so little time i think about it and bought the herbal medicine which i took for three weeks and i was totally cured his treatment is so unique,I never thought i will be able to be free from Lung Cancer.But not only this Lung Cancer This great man can cure,Dr Itua also told me he can cure such diseases like... COLORECTAL CANCER,Brain cancer,Esophageal cancer,Gallbladder cancer,Gestational trophoblastic disease,Head and neck cancer, BLADDER CANCER, PROSTATE CANCER, KIDNEY CANCER, LUNG CANCER, Lupus,SKIN CANCER,Glaucoma., Cataracts,Macular degeneration,Cardiovascular disease,Lung disease.Enlarged prostate,Osteoporosis.Alzheimer's disease,Ovarian cancer,Sinus cancer,Skin cancer,Soft tissue sarcoma,Spinal cancer,Stomach cancer,Testicular cancer,Throat cancer,Thyroid Cancer,Stroke,Dementia. UTERINE CANCER,Pancreative Cancer, LEUKEMIA,HIV/AIDS,OVARIAN CANCER,BLOOD CANCER,Vulvar cancer,MEN/WOMAN INFERTILITY,BURKITT LYMPHOMA - NON-HODGKIN.BRONNCHIAL TUMORS, BRAIN TUMORS,BILE DUCT CANCER,BONE CANCER,VAGINAL CANCER,Cervical Cancer,HERPES VIRUS,LOVE SPELL,HEPATITIS,HE'S A GREAT HERBAL DOCTOR.HERE HIS CONTACT EMAIL::: drituaherbalcenter@gmail.com/. WHATSAPP:::+2348149277967
ReplyDelete