Sunday, May 13, 2018

Integrating Jenkins + GitHub + WSO2 ESB 5.0.0

In the space of Continuous Integration with WSO2 ESB, the common scenario of integration we encounter is the integration of the combination Jenkins + GitHub + WSO2 ESB 5.0.0. In this article we are going to integrate these three from the scratch.

What we are going to do?
Prerequisites Version Used
1) Ubuntu 14.04.5 LTS
2) Java 1.8.0_171
3) Apache Maven 3.0.5
4) Gradle 2.6
5) WSO2 ESB 5.0.0
6) WSO2 ESB Tooling 5.0.0

Contents Included
1) Installation of Jenkins in Ubuntu 14.04
2) Creating an API project in WSO2 ESB Tooling and configuring Gradle build
3) Pushing the WSO2 Code to Git Repository
4) Configuring the Jenkins Job
5) Verification

1) Installation of Jenkins in Ubuntu 14.04


Execute the below commands to install Jenkins in local Ubuntu Distribution.
  wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -   
  sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'   
  sudo apt-get update   
  sudo apt-get install jenkins  

Once execution done we can see a screen as below asking to input a password - which we need to get from /var/lib/jenkins/secrets/initialAdminPassword


Once we successfully entered the admin password we were able to see the page as below.


Here, I'm selecting "Select plugins to install" tab as it will give us some idea what we are installing. Check and enable if any specific plugins needs to be installed and then click on the install.




That's it - now we are ready to use our Jenkins.



2) Creating an API project in WSO2 ESB Tooling and configuring Gradle build


When we create a ESB project we need to create two projects ESB Config Project and Composite Application Project. The first one is to create our artifacts and the second one is to create the CAR file which is the one WSO2 uses to deploy in WSO2 ESB. Go through the below screen shots which will help to understand the project structure and the creation of artifacts.







Now we need to create the Composite Application Project. To create that follow the below screen shots.




Now we are done with the initial WSO2 configurations, now we need make our project to build using Gradle. Currently the project structure will be look as below:




First will add the build.gradle files to the sub projects and then will add the configurations to the root project. The below image will give details on how the sub projects were added with gradle configurations.



Once we are done with this one additional configuration we need to add is to configure the CAPP projects pom.xml to point to the correct wso2carbon.jks location, this is needed when deploying the CAR application to the WSO2 ESB Server.
  <plugin>  
     <groupId>org.wso2.maven</groupId>  
     <artifactId>maven-car-deploy-plugin</artifactId>  
     <version>1.1.1</version>  
     <extensions>true</extensions>  
     <configuration>  
      <carbonServers>  
       <CarbonServer>  
        <trustStorePath>${basedir}/../resources/wso2carbon.jks</trustStorePath>  
        <trustStorePassword>wso2carbon</trustStorePassword>  
        <trustStoreType>JKS</trustStoreType>  
        <serverUrl>https://localhost:9443</serverUrl>  
        <userName>admin</userName>  
        <password>admin</password>  
        <operation>deploy</operation>  
       </CarbonServer>  
      </carbonServers>  
     </configuration>  
    </plugin>  

Now we can move to the gradle configuration of our root project. Below is my configured folders and files screen shot.


resources - Have the wso2carbon.jks
gradle - Consists of the gradle wrapper jar
gradlew and gradle.bat - This is the executables for linux and windows
settings.gradle - To specify our root and sub projects
build.gradle - The main build file for the root project.

The contents of the settings.gradle and build.gradle are as below:


 rootProject.name ='test-esb-jenkins-integration'  
 include 'TestESBRespondBackAPI'  
 include 'TestESBRespondBackCAPP'  

 buildscript {  
       repositories {  
              jcenter()  
              mavenCentral()  
            maven { url 'http://maven.wso2.org/nexus/content/groups/wso2-public' }  
  }  
 }  
 group = 'test-esb-jenkins-integration'  
 version = '1.0.0'  
 apply plugin: 'java'  
 apply plugin: 'maven-publish'  
 task buildAndDeployCAR() {  
   println "Executing the build and CAR deployment task..."  
   dependsOn ':TestESBRespondBackAPI:buildWSO2'  
   dependsOn ':TestESBRespondBackCAPP:deployWSO2'  
   tasks.findByPath(':TestESBRespondBackCAPP:deployWSO2').mustRunAfter ':TestESBRespondBackAPI:buildWSO2'  
 }  

Now we are ready to build our project. Make sure the WSO2 ESB 5.0.0 is up and running in the default port. Then execute the below command.
 ./gradlew buildAndDeployCAR  

 /test-esb-jenkins-integration$ ./gradlew buildAndDeployCAR  
 Executing the build and CAR deployment task...  
 :TestESBRespondBackAPI:buildWSO2  
 [INFO] Scanning for projects...  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI ---  
 [INFO] Deleting /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:pom-gen (api) @ TestESBRespondBackAPI ---  
 [INFO] Creating maven project for artifact TestESBRespondAPI:1.0.0...  
 [INFO] generating maven project...  
 [INFO] copying resources...  
 [INFO]   
 [INFO] --- exec-maven-plugin:1.4.0:exec (package) @ TestESBRespondBackAPI ---  
 [INFO] Scanning for projects...  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Build Order:  
 [INFO]   
 [INFO] TestESBRespondAPI  
 [INFO] TestESBRespondBackAPI_module  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondAPI ---  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondAPI ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:package-api (default-package-api) @ TestESBRespondAPI ---  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI_module 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI_module ---  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Summary:  
 [INFO]   
 [INFO] TestESBRespondAPI ................................. SUCCESS [1.115s]  
 [INFO] TestESBRespondBackAPI_module ...................... SUCCESS [0.024s]  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 1.614s  
 [INFO] Finished at: Sun May 13 10:16:23 BST 2018  
 [INFO] Final Memory: 11M/211M  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-install-plugin:2.3:install (default-install) @ TestESBRespondBackAPI ---  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/pom.xml to /home/engineer/.m2/repository/com/example/TestESBRespondBackAPI/TestESBRespondBackAPI/1.0.0/TestESBRespondBackAPI-1.0.0.pom  
 [INFO]   
 [INFO] --- exec-maven-plugin:1.4.0:exec (install) @ TestESBRespondBackAPI ---  
 [INFO] Scanning for projects...  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Build Order:  
 [INFO]   
 [INFO] TestESBRespondAPI  
 [INFO] TestESBRespondBackAPI_module  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondAPI ---  
 [INFO] Deleting /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/target  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondAPI ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:package-api (default-package-api) @ TestESBRespondAPI ---  
 [INFO]   
 [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ TestESBRespondAPI ---  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/target/TestESBRespondAPI-1.0.0.xml to /home/engineer/.m2/repository/com/example/TestESBRespondBackAPI/api/TestESBRespondAPI/1.0.0/TestESBRespondAPI-1.0.0.xml  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/pom.xml to /home/engineer/.m2/repository/com/example/TestESBRespondBackAPI/api/TestESBRespondAPI/1.0.0/TestESBRespondAPI-1.0.0.pom  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI_module 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI_module ---  
 [INFO]   
 [INFO] --- maven-install-plugin:2.3:install (default-install) @ TestESBRespondBackAPI_module ---  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackAPI/target/capp/pom.xml to /home/engineer/.m2/repository/com/example/TestESBRespondBackAPI/TestESBRespondBackAPI_module/1.0.0/TestESBRespondBackAPI_module-1.0.0.pom  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Summary:  
 [INFO]   
 [INFO] TestESBRespondAPI ................................. SUCCESS [1.225s]  
 [INFO] TestESBRespondBackAPI_module ...................... SUCCESS [0.140s]  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 1.794s  
 [INFO] Finished at: Sun May 13 10:16:26 BST 2018  
 [INFO] Final Memory: 12M/211M  
 [INFO] ------------------------------------------------------------------------  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 7.544s  
 [INFO] Finished at: Sun May 13 10:16:26 BST 2018  
 [INFO] Final Memory: 11M/211M  
 [INFO] ------------------------------------------------------------------------  
 :TestESBRespondBackCAPP:deployWSO2  
 [INFO] Scanning for projects...  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackCAPP 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackCAPP ---  
 [INFO] Deleting /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackCAPP/target  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondBackCAPP ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackCAPP/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondBackCAPP ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondBackCAPP ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackCAPP/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondBackCAPP ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondBackCAPP ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- maven-car-plugin:2.1.1:car (default-car) @ TestESBRespondBackCAPP ---  
 log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAXUtils).  
 log4j:WARN Please initialize the log4j system properly.  
 [INFO] Generating artifact descriptor for artifact: TestESBRespondAPI  
 [INFO] Copying artifact content to target location.  
 [INFO]   
 [INFO] --- maven-car-plugin:2.1.1:car (car) @ TestESBRespondBackCAPP ---  
 [INFO] Generating artifact descriptor for artifact: TestESBRespondAPI  
 [INFO] Copying artifact content to target location.  
 [INFO]   
 [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ TestESBRespondBackCAPP ---  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackCAPP/target/TestESBRespondBackCAPP_1.0.0.car to /home/engineer/.m2/repository/com/example/TestESBRespondBackCAPP/TestESBRespondBackCAPP/1.0.0/TestESBRespondBackCAPP-1.0.0.car  
 [INFO] Installing /home/engineer/wso2_certification/test-esb-jenkins-integration/TestESBRespondBackCAPP/pom.xml to /home/engineer/.m2/repository/com/example/TestESBRespondBackCAPP/TestESBRespondBackCAPP/1.0.0/TestESBRespondBackCAPP-1.0.0.pom  
 [INFO]   
 [INFO] --- maven-car-deploy-plugin:1.1.1:deploy-car (default-deploy-car) @ TestESBRespondBackCAPP ---  
 [INFO] Deploying to Server...  
 [INFO] TSPath=../resources/wso2carbon.jks  
 [INFO] TSPWD=wso2carbon  
 [INFO] TSType=JKS  
 [INFO] Server URL=https://localhost:9443  
 [INFO] UserName=admin  
 [INFO] Password=admin  
 [INFO] Operation=deploy  
 log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisOperation).  
 log4j:WARN Please initialize the log4j system properly.  
 [INFO] Authentication to https://localhost:9443 successful.  
 [INFO] Uploading TestESBRespondBackCAPP_1.0.0.car to https://localhost:9443...  
 [INFO] Uploading TestESBRespondBackCAPP_1.0.0.car to https://localhost:9443 completed successfully.  
 [INFO]   
 [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ TestESBRespondBackCAPP ---  
 [INFO] Skipping artifact deployment  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 3.692s  
 [INFO] Finished at: Sun May 13 10:16:31 BST 2018  
 [INFO] Final Memory: 20M/351M  
 [INFO] ------------------------------------------------------------------------  
 :buildAndDeployCAR  
 BUILD SUCCESSFUL  
 Total time: 15.373 secs  
 engineer@engineer-VirtualBox:~/wso2_certification/test-esb-jenkins-integration$   

Based on the above logs we can confirm our setup working properly.

3) Pushing the WSO2 Code to Git Repository

To do this, create a new repository in your GitHub account.



Now execute the below commands to push our local code to Git Repository.

 git init  
 git add .  
 git commit -m "Skeleton Project Commit"  
 git remote add origin https://github.com/ajanthanerepo/test-esb-jenkins-integration.git  
 git push -u origin master  


4) Configuring the Jenkins Job

As of now we are done with the WSO2 ESB and GitHub Configurations, now we can move to configure our source code repository to build and deploy using Jenkins. To continue on that follow the screen shots.

Go to the Jenkins http://localhost:8080 and log into the console and follow the screens.







5) Verification

To verify our setup working properly - just execute the Build Now option and check the log console.
 Started by user Ajanthan  
 Building in workspace /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject  
 [WS-CLEANUP] Deleting project workspace...  
 [WS-CLEANUP] Done  
 Cloning the remote Git repository  
 Cloning repository https://github.com/ajanthanerepo/test-esb-jenkins-integration.git  
  > git init /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject # timeout=10  
 Fetching upstream changes from https://github.com/ajanthanerepo/test-esb-jenkins-integration.git  
  > git --version # timeout=10  
  > git fetch --tags --progress https://github.com/ajanthanerepo/test-esb-jenkins-integration.git +refs/heads/*:refs/remotes/origin/*  
  > git config remote.origin.url https://github.com/ajanthanerepo/test-esb-jenkins-integration.git # timeout=10  
  > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10  
  > git config remote.origin.url https://github.com/ajanthanerepo/test-esb-jenkins-integration.git # timeout=10  
 Fetching upstream changes from https://github.com/ajanthanerepo/test-esb-jenkins-integration.git  
  > git fetch --tags --progress https://github.com/ajanthanerepo/test-esb-jenkins-integration.git +refs/heads/*:refs/remotes/origin/*  
  > git rev-parse refs/remotes/origin/master^{commit} # timeout=10  
  > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10  
 Checking out Revision e1d87e4f0a6a72511e9278033b558e095cefd801 (refs/remotes/origin/master)  
  > git config core.sparsecheckout # timeout=10  
  > git checkout -f e1d87e4f0a6a72511e9278033b558e095cefd801  
 Commit message: "upadted pom"  
  > git rev-list --no-walk 6c3359a631ddce5d7404bd4a278bd617dfcd884d # timeout=10  
 [Gradle] - Launching build.  
 [TestESBJenkinsIntegrationProject] $ /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/gradlew buildAndDeployCAR  
 Executing the build and CAR deployment task...  
 :TestESBRespondBackAPI:buildWSO2  
 [INFO] Scanning for projects...  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI ---  
 [INFO] Deleting /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:pom-gen (api) @ TestESBRespondBackAPI ---  
 [INFO] Creating maven project for artifact TestESBRespondAPI:1.0.0...  
 [INFO]      generating maven project...  
 [INFO]      copying resources...  
 [INFO]   
 [INFO] --- exec-maven-plugin:1.4.0:exec (package) @ TestESBRespondBackAPI ---  
 [INFO] Scanning for projects...  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Build Order:  
 [INFO]   
 [INFO] TestESBRespondAPI  
 [INFO] TestESBRespondBackAPI_module  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondAPI ---  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondAPI ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:package-api (default-package-api) @ TestESBRespondAPI ---  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI_module 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI_module ---  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Summary:  
 [INFO]   
 [INFO] TestESBRespondAPI ................................. SUCCESS [1.296s]  
 [INFO] TestESBRespondBackAPI_module ...................... SUCCESS [0.033s]  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 2.020s  
 [INFO] Finished at: Sun May 13 11:10:00 BST 2018  
 [INFO] Final Memory: 11M/208M  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-install-plugin:2.3:install (default-install) @ TestESBRespondBackAPI ---  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/pom.xml to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackAPI/TestESBRespondBackAPI/1.0.0/TestESBRespondBackAPI-1.0.0.pom  
 [INFO]   
 [INFO] --- exec-maven-plugin:1.4.0:exec (install) @ TestESBRespondBackAPI ---  
 [INFO] Scanning for projects...  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Build Order:  
 [INFO]   
 [INFO] TestESBRespondAPI  
 [INFO] TestESBRespondBackAPI_module  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondAPI 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondAPI ---  
 [INFO] Deleting /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/target  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondAPI ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondAPI ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondAPI ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- wso2-esb-api-plugin:2.1.0:package-api (default-package-api) @ TestESBRespondAPI ---  
 [INFO]   
 [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ TestESBRespondAPI ---  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/target/TestESBRespondAPI-1.0.0.xml to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackAPI/api/TestESBRespondAPI/1.0.0/TestESBRespondAPI-1.0.0.xml  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/artifacts/api/TestESBRespondAPI/pom.xml to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackAPI/api/TestESBRespondAPI/1.0.0/TestESBRespondAPI-1.0.0.pom  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackAPI_module 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackAPI_module ---  
 [INFO]   
 [INFO] --- maven-install-plugin:2.3:install (default-install) @ TestESBRespondBackAPI_module ---  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackAPI/target/capp/pom.xml to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackAPI/TestESBRespondBackAPI_module/1.0.0/TestESBRespondBackAPI_module-1.0.0.pom  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Reactor Summary:  
 [INFO]   
 [INFO] TestESBRespondAPI ................................. SUCCESS [1.392s]  
 [INFO] TestESBRespondBackAPI_module ...................... SUCCESS [0.089s]  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 2.192s  
 [INFO] Finished at: Sun May 13 11:10:04 BST 2018  
 [INFO] Final Memory: 11M/208M  
 [INFO] ------------------------------------------------------------------------  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 9.326s  
 [INFO] Finished at: Sun May 13 11:10:04 BST 2018  
 [INFO] Final Memory: 9M/165M  
 [INFO] ------------------------------------------------------------------------  
 :TestESBRespondBackCAPP:deployWSO2  
 [INFO] Scanning for projects...  
 [INFO]                                       
 [INFO] ------------------------------------------------------------------------  
 [INFO] Building TestESBRespondBackCAPP 1.0.0  
 [INFO] ------------------------------------------------------------------------  
 [INFO]   
 [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestESBRespondBackCAPP ---  
 [INFO] Deleting /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/target  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ TestESBRespondBackCAPP ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/src/main/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:compile (default-compile) @ TestESBRespondBackCAPP ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ TestESBRespondBackCAPP ---  
 [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!  
 [INFO] skip non existing resourceDirectory /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/src/test/resources  
 [INFO]   
 [INFO] --- maven-compiler-plugin:3.7.0-jboss-1:testCompile (default-testCompile) @ TestESBRespondBackCAPP ---  
 [INFO] No sources to compile  
 [INFO]   
 [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ TestESBRespondBackCAPP ---  
 [INFO] No tests to run.  
 [INFO]   
 [INFO] --- maven-car-plugin:2.1.1:car (default-car) @ TestESBRespondBackCAPP ---  
 log4j:WARN No appenders could be found for logger (org.apache.axiom.om.util.StAXUtils).  
 log4j:WARN Please initialize the log4j system properly.  
 [INFO] Generating artifact descriptor for artifact: TestESBRespondAPI  
 [INFO] Copying artifact content to target location.  
 [INFO]   
 [INFO] --- maven-car-plugin:2.1.1:car (car) @ TestESBRespondBackCAPP ---  
 [INFO] Generating artifact descriptor for artifact: TestESBRespondAPI  
 [INFO] Copying artifact content to target location.  
 [INFO]   
 [INFO] --- maven-install-plugin:2.5.2:install (default-install) @ TestESBRespondBackCAPP ---  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/target/TestESBRespondBackCAPP_1.0.0.car to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackCAPP/TestESBRespondBackCAPP/1.0.0/TestESBRespondBackCAPP-1.0.0.car  
 [INFO] Installing /var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/pom.xml to /var/lib/jenkins/.m2/repository/com/example/TestESBRespondBackCAPP/TestESBRespondBackCAPP/1.0.0/TestESBRespondBackCAPP-1.0.0.pom  
 [INFO]   
 [INFO] --- maven-car-deploy-plugin:1.1.1:deploy-car (default-deploy-car) @ TestESBRespondBackCAPP ---  
 [INFO] Deploying to Server...  
 [INFO] TSPath=/var/lib/jenkins/workspace/TestESBJenkinsIntegrationProject/TestESBRespondBackCAPP/../resources/wso2carbon.jks  
 [INFO] TSPWD=wso2carbon  
 [INFO] TSType=JKS  
 [INFO] Server URL=https://localhost:9443  
 [INFO] UserName=admin  
 [INFO] Password=admin  
 [INFO] Operation=deploy  
 log4j:WARN No appenders could be found for logger (org.apache.axis2.description.AxisOperation).  
 log4j:WARN Please initialize the log4j system properly.  
 [INFO] Authentication to https://localhost:9443 successful.  
 [INFO] Uploading TestESBRespondBackCAPP_1.0.0.car to https://localhost:9443...  
 [INFO] Uploading TestESBRespondBackCAPP_1.0.0.car to https://localhost:9443 completed successfully.  
 [INFO]   
 [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ TestESBRespondBackCAPP ---  
 [INFO] Skipping artifact deployment  
 [INFO] ------------------------------------------------------------------------  
 [INFO] BUILD SUCCESS  
 [INFO] ------------------------------------------------------------------------  
 [INFO] Total time: 3.610s  
 [INFO] Finished at: Sun May 13 11:10:09 BST 2018  
 [INFO] Final Memory: 21M/294M  
 [INFO] ------------------------------------------------------------------------  
 :buildAndDeployCAR  
 BUILD SUCCESSFUL  
 Total time: 20.403 secs  
 This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html  
 Build step 'Invoke Gradle script' changed build result to SUCCESS  
 Finished: SUCCESS  



That's it and hope this helps someone who just starting into the Jenkins _ GitHub + WSO2 ESB Integration space.

All the source code can be found at https://github.com/ajanthanerepo/test-esb-jenkins-integration.git

References