Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How to create maven build POM file for Oracle BPEL 12.1.3 project

How to create maven build POM file for Oracle BPEL 12.1.3 project

Before proceed to create POM file. We need to create Oracle SOA repository. The following command will create the repositotirs. 

  • Assume the  Oracle BPM 12.1.3 installed on the directory C:\Oracle\Middleware\Oracle_Home
  • Set the following property 
export M2_HOME=C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\org.apache.maven_3.0.5


export PATH=${M2_HOME}/bin:$PATH
  • Download the wagon-http-2.8-shaded.jar and place it under the M2_hOME\lib directoty 
  • Optionally, update the Oracle repository in your Maven settings.xml file . This will give access to Maven to download jar from Oracle Maven URL. Replace the Username and password with yours 
maven.oracle.comUSERNAMEPASSWORDANYANYOAM 11ghttp.protocol.allow-circular-redirects%b,truemaven.oracle.comtruefalsehttps://maven.oracle.comdefaultmaven.oracle.comhttps://maven.oracle.com
  • Go to the Maven Sync Plugin directory and install the Oracle Sync plugin
cd C:\Oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3


mvn install:install-file -DpomFile=./oracle-maven-sync-12.1.3.pom -Dfile=./oracle-maven-sync-12.1.3.jar
  • Test the Oracle repository using testingOnly=true 

  

mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=c:\Oracle\Middleware\Oracle_Home\ -DtestingOnly=true
  • Install the Oracle repositories using testingOnly = true 
mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=c:\Oracle\Middleware\Oracle_Home\ -DtestingOnly=false
  • Do the Maven CRAWL.
cd C:\Oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3

mvn archetype:crawl -Dcatalog=C:\Users\dz0003\.m2\archetype-catalog.xml

Sample archetype-catalog.xml in C:\Users\dz0003\.m2. JDeveloper look for this file when you create POM from Archetype 

com.oracle.adf.archetype
      oracle-adffaces-ejb
      12.1.3-0-0adfFusionWebappcom.oracle.coherence
      maven-gar-archetype
      12.1.3-0-0maven-gar-archetypecom.oracle.servicebus.archetype
      oracle-servicebus-application
      12.1.3-0-0oracle-servicebus-applicationcom.oracle.servicebus.archetype
      oracle-servicebus-project
      12.1.3-0-0projectcom.oracle.servicebus.archetype
      oracle-servicebus-system
      12.1.3-0-0applicationcom.oracle.soa.archetype
      oracle-soa-application
      12.1.3-0-0maven-sar-archetypecom.oracle.soa.archetype
      oracle-soa-project
      12.1.3-0-0maven-sar-archetypecom.oracle.weblogic.archetype
      basic-mdb
      12.1.3-0-0basicMDBcom.oracle.weblogic.archetype
      basic-webapp
      12.1.3-0-0basicJsfcom.oracle.weblogic.archetype
      basic-webapp-ejb
      12.1.3-0-0cdicom.oracle.weblogic.archetype
      basic-webservice
      12.1.3-0-0basicWebservice

Create Pom for Oracle BPEL projects and Applications

  • Build SOA Application:
mvn archetype:generate
     -DarchetypeGroupId=com.oracle.soa.archetype
     -DarchetypeArtifactId=oracle-soa-application
     -DarchetypeVersion=12.1.3-0-0
     -DgroupId=org.mycompany
     -DartifactId=my-soa-app
     -Dversion=1.0-SNAPSHOT
     -DprojectName=my-project
  • Build SOA Project: 
mvn archetype:generate
    -DarchetypeGroupId=com.oracle.soa.archetype
    -DarchetypeArtifactId=oracle-soa-project
    -DarchetypeVersion=12.1.3-0-0
    -DgroupId=org.mycompany
    -DartifactId=my-second-project
    -Dversion=1.0-SNAPSHOT

Deploy SOA Project: 

mvn archetype:generate
    -DarchetypeGroupId=com.oracle.soa.archetype
    -DarchetypeArtifactId=oracle-soa-project
    -DarchetypeVersion=12.1.3-0-0
    -DgroupId=org.mycompany
    -DartifactId=my-second-project
    -Dversion=1.0-SNAPSHOT
  • Undeploy SOA Project 
mvn com.oracle.soa.plugin:oracle-soa-plugin:undeploy
    -DserverURL=http://test.server:7001
    -Dcomposite.name=my-project
    -Dcomposite.revision=1.0
    -Dcomposite.partition=test
    -Duser=weblogic
    -Dpassword=welcome1
  • We can also create Maven POM from JDeveloper . To do that, right click on the BPEL/SOA project , New, Search for maven and select Maven POM for Project 

 

Sample BPEL Project POM File: 

4.0.0APPLICATIONAME
  PROJECTNAME
  1.0sarcom.oracle.soa
    sar-common
    12.1.3-0-0
      ${project.basedir}\SOA/
    
      ${project.basedir}/target
    
      ${scac.input.dir}/composite.xml
    
      ${scac.output.dir}/out.xml
    
      ${scac.output.dir}/error.txt
    
      1
    
      ${project.artifactId}
    
      1.0
    
      default
    
	  ${oracleServerUrl}
    
	  ${oracleUsername}
    
	  ${oraclePassword}
    
      true
    
      true
    
      false
    
      false
    
      ${scac.output.dir}/testResult
    
      ${project.artifactId}
    
    
  org.apache.maven.plugins
        maven-surefire-plugin
        2.19.1falsecom.oracle.soa.plugin
        oracle-soa-plugin
        12.1.3-0-0
            ${project.artifactId}
          
            ${scac.input}
          
            ${scac.output.dir}/sca_${project.artifactId}_rev${composite.revision}.jar
          
            ${serverUrl}
          
            ${user}
          
            ${password}
          
            ${composite.revision}
          
            ${composite.revision}
          
            ${scac.input.dir}
          
            ${input}
          
        true

Sample BPEL Project with Java activity with  jar dependancy SCA-INF\lib directory: 

4.0.0ApplicationName
  ProjectName
  1.0sarcom.oracle.soa
    sar-common
    12.1.3-0-0
      ${project.basedir}
    
      ${project.basedir}/target
    
      ${scac.input.dir}/composite.xml
    
      ${scac.output.dir}/out.xml
    
      ${scac.output.dir}/error.txt
    
      1
    
      ${project.artifactId}
    
      1.0
    
      default
    
      ${oracleServerUrl}
    
      ${oracleUsername}
    
      ${oraclePassword}
    
      true
    
      true
    
      false
    
      false
    
      ${scac.output.dir}/testResult
    
      ${project.artifactId}
    
    
  org.apache.maven.plugins
		maven-dependency-plugin
		3.0.2copyvalidatecopyorg.apache.commons
						commons-lang3
						3.7jarfalse${scac.input.dir}/SCA-INF/liborg.apache.maven.plugins
        maven-surefire-plugin
        2.19.1falsecom.oracle.soa.plugin
        oracle-soa-plugin
        12.1.3-0-0
            ${project.artifactId}
          
            ${scac.input}
          
            ${scac.output.dir}/sca_${project.artifactId}_rev${composite.revision}.jar
          
            ${serverUrl}
          
            ${user}
          
            ${password}
          
            ${composite.revision}
          
            ${composite.revision}
          
            ${scac.input.dir}
          
            ${input}
          
		  **/target/true

Oracle BPEL Application POM:- 

4.0.0ApplicationName
  ApplicationName
  1.0-SNAPSHOTSuper POMBPELProject1BPELProject2BPELProject2pom

Maven Test Commands

  • Undeploy a Partition from the default partition
cd to your pom.xml 

mvn com.oracle.soa.plugin:oracle-soa-plugin:undeploy -Dpartition=default 
  • Compile the Project 
cd to your BPEM PROJECT where the  pom.xml is located 

mvn com.oracle.soa.plugin:oracle-soa-plugin:compile -DoracleHome=c:\Oracle\Middleware\Oracle_Home\soa -DappHome=
  • Package the Project 
cd to your BPEM PROJECT where the pom.xml is located



mvn package -DoracleHome=c:\Oracle\Middleware\Oracle_Home\soa -DappHome=
  • Deploy the Project
mvn pre-integration-test -DoracleHome=c:\Oracle\Middleware\Oracle_Home\soa -DappHome= -Dpartition=default

Troubleshooting: 

  • I faced the following error during the deployment face

[ERROR] Unresolveable build extension: Plugin com.oracle.soa.plugin:oracle-soa-plugin:12.1.3-0-0 or one of its dependencies could not be resolved: Failed to collect dependencies for com.oracle.soa.plugin:oracle-soa-plugin:jar:12.1.3-0-0 (): No versions available for com.oracle.weblogic:weblogic:jar:[12.1.3,12.1.4) within specified range -> [Help 2]

  • The solution would be to find the pom file in the repository  where the [12.1.3,12.1.4) is written and replace it with 12.1.3-0-0. One of the way to find the above text in your repository and replace is using Notepad++ in windows. 
  1. Open Notepad++ and do CTRL+SHIFT+F ,  Click Find in Files tab , Search for the appropriate text and replace it like below.  

Another issue is some  jars are missing in repository. I used the following windows powershell command to find the jar from Oracle Home and place it in repository

Get-ChildItem -recurse | Select-String -pattern "logging-utils-1.0.jar" | group path | select name


This post first appeared on Oracle ADF, BPM, BI And Primavera P6 Tutorials, please read the originial post: here

Share the post

How to create maven build POM file for Oracle BPEL 12.1.3 project

×

Subscribe to Oracle Adf, Bpm, Bi And Primavera P6 Tutorials

Get updates delivered right to your inbox!

Thank you for your subscription

×