Saturday 27 December 2014

Create 12c SOA Application and SOA Project by using Maven


Create SOA Application and SOA Project by using Maven

Prerequisite: Maven setup in Jdeveloper 12c

To use maven to create SOA application and SOA project we should setup maven in developer machine.

Step1: In cmd prompt, setup below env variables
                set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
                set PATH=%JAVA_HOME%\bin;%PATH%
                set ORACLE_HOME=D:\Fusion12C\Oracle\Middleware\Oracle_Home
                set M2_HOME=<ORACLE_HOME>\oracle_common\modules\org.apache.maven_3.0.5
                set PATH=%M2_HOME%\bin;%PATH%

Step2: Run below mvn cmd to create soa application and soa project.
mvn archetype:generate -DarchetypeGroupId=com.oracle.soa.archetype -DarchetypeArtifactId=oracle-soa-application -DarchetypeVersion=12.1.3-0-0 -DarchetypeRepository=local

Fill below details in CMD prompt:
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
Define value for property 'groupId': : com.test
Define value for property 'artifactId': : SOA12cApplicationWithMVN
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'version':  1.0-SNAPSHOT: :
Define value for property 'package':  com.test: :
[INFO] Using property: adf = .adf
[INFO] Using property: data = .data
Define value for property 'projectName': : SOA12cProjectWithMVN
Confirm properties configuration:
groupId: com.test
artifactId: SOA12cApplicationWithMVN
version: 1.0-SNAPSHOT
package: com.test
adf: .adf
data: .data
projectName: SOA12cProjectWithMVN
Y: :Y

NOTE: If first time you are running "generate" maven goal then you may get error says that "maven goal or respective POM file is not available in maven repositery". If you see this kind of error then execute below maven goal. Below mvn cmd will download all required mvn jar files and pom files.
--> mvn archetype:generate

Step3: If we observe physical folders where we created SOA application and SOA Project , we dont have .jws and .jpr files.
Step4: Now open SOA application in JDeveloper 12c by following below steps.





Now we can see SOA application and SOA project in Jdeveloper12c.
We can see .jws and .jpr files in physical file system.


Step5: Now we can implement required business logic in composite.

Step6: Once we create required business logic we can deploy soa project in to SOA server.
For deployment we can use traditional deployment process by using jdeveloper.
In this post i want to show you steps to deploy soa project with maven goal.

--> mvn pre-integration-test

NOTE: If you are using this mvn cmd first time then it will download all required prerequisite jars and pom files.

If you get this kind of error, then you have to modify project level pom file with required server properties as shown below.

Modify the server details in your project level pom file, in which server you want to deploy the program. I am using integrated SOA server in JDeveloper so i provided local host details, you should provide as per your server environment.

NOTE:
Project level pom file available in "<mywork>\<application name>\<project name>\pom.xml"

Now run the mvn cmd to deploy SOA project.
--> mvn pre-integration-test

Step7: We can see deployed soa project in enterprise manager.




No comments:

Post a Comment