IIB (v9 & v10) Continuous Integration-Maven-Jenkins
IIB (v9 & v10) Continuous Integration-Maven-Jenkins
IIB (v9 & v10) Continuous Integration-Maven-Jenkins
29
Anand.Awasthi
Published on December 3, 2018 / Updated on November 18, 2019
In this article I will explain how to build an IIB (IBM Integration Bus v9 & v10) project and deploy the bar file to target Integration Server
using Maven and Jenkins. Here I will take a basic scenario and will explain all the steps. You should be able to use this information to build
the CI infrastructure for IIB in your enterprise.
Scenario
Build IIB (v9 & v10) projects
Create BAR file with all referenced libraries/projects/jars
Overwrite BAR file Node properties and User Defined Properties using Properties file
Deploy this BAR file on target Integration Server
Environment
IIB v9, v10
Maven 3.3.3
Jenkins 1.632
IIB-Maven-Plugin (from GitHub)
Maven Eclipse Plugin (m2e) v1.4.1
TFS (Team Foundation Server) 2012
Operating System
Windows 7
Ensure JAVA_HOME environment variable is set and points to your JDK installation
Add the bin directory of the created directory apache-maven-3.3.3 to the PATH environment variable
Confirm with mvn -v in a new shell. The result should look similar to;
Optionally you can change the local repository location in maven settings.xml . You can find settings.xml in ‘conf’ directory inside your
maven installation directory.
v9 plugin
After you download this plugin, unzip the file in any directory. You can install this plugin in the central repository of your enterprise. Here we
will install it locally.
Open command prompt and go to the directory where you extracted it. Navigate to the directory where POM file is present and run the
command “mvn clean install”
This will install the iib-maven-plugin in your local repository. If installed successfully, you will see the ‘BUILD SUCCESS’ message as below:
Make sure you uncheck the check-box ‘Show only the latest versions of software available’. Install m2e-Maven Integration for Eclipse
1.4.1 and m2e-slf4j over logback logging v1.4.1
Complete the installation and restart IIB toolkit.
Now change settings in your toolkit to refer to custom maven installation instead of Embedded installation. Go to Window–
>Preferences–>Maven–>Installations. Add the maven installation directory.
Now checkout the IIB project into your IIB toolkit. Right click on the project –> Configure –> Convert to Maven project.
Provide the groupId, artifcatId and Version and select packaging as ‘pom’.
Click on Finish.
Now we need to make configurations in POM file. Here I have put central repository info in POM; ideally we should put it in settings.xml.
Below is a complete sample POM for the project I created:
Sample POM (also added as an attachment)
<groupId>com.endur.esb.dummy</groupId>
<artifactId>GeniusStatus_Dummy_App</artifactId>
<version>1.0</version>
<packaging>iib-bar</packaging>
You can update the central repository info or remove it. By default it will go to internet.
Keep the other settings the same as that of in the sample POM.
Now your IIB Maven project is ready to compile. Make sure that the referenced projects are present in ‘workspace’.
http://jenkins-ci.org/content/thank-you-downloading-windows-installer
The installation is straightforward. Once installation is complete, you can access Jenkins using below url:
http://localhost:8080
You can do access configuration in Jenkins using LDAP or AD server or local access setup. This part is not in scope of this article. We can
continue without doing this access setup.
Click on ‘New Item’ and give name to item. Select the check-box ‘maven-project’ and click ‘Ok’
Now the Configuration page is open. We need to provide the configuration here. Please note that here I am setting to check-out only
main project from TFS assuming that previous jobs will do a ‘checkout only’ of referenced projects in workspace. Provide the project
paths and credential to checkout from TFS:
Select the appropriate Build Trigger.
I triggered the jenkins job and it built the bar file, overridden a node property using properties file and deployed this new bar file to target
integration server. Attached is the sample properties files:
Sample Properties File (also added as an attachment)
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
MQSI 9.0.0.3
C:\Program Files\IBM\MQSI\9.0.0.3
This article was originally published on Blogger.com and has been updated on 08/24/2018 to support build of IIB 10 projects. Wherever is
mentioned v9 only, read it as v9 & v10.
V10 plugin allows you to make Shared libraries as maven projects & build them independently. Note that the plugin code has been updated
to make sure that shared libraries are not included in the bar files of referring projects to avoid unplanned changes in shared library going
into runtime. You may wish to refer to the original article to review comments and replies.
Note- The v9 IIB-Maven-Plugin source code was originally taken from GitHub and was modified to fix the issues. Also the plugin code was
modified for v10 to support shared libraries. The updated copies of v9 and v10 plugin codes can be downloaded from links provided in this
article.
Anand.Awasthi
Reply (Edit)
Great job & many thanks for this article, I did execute a job using your instructions. However there is one step I need to do “manually” in order to
make this work.
In the goal/step “default-package-iib-bar”, after assembly (iib-bar-project.xml) is interpolated, it forms like below
.
target/iib
If you see above, it expects a directory “target/iib” inside my work-space. So whenever I start my build I have to create this directory “iib” manually
inside my folder ‘target’. This is not a one time folder creation, because the ‘target’ folder regenerates each time for new build. So do you know how
should I fix this ? If I do not do this manual step then I’m thrown error
“Failed to execute goal ch.sbb.maven.plugins:iib-maven-plugin:4.3-SNAPSHOT:package-iib-bar (default-package-iib-bar) on project XXXXXXX:
Unable to execute mojo: Failed to create assembly: Error creating assembly archive iib-project: You must set at least one file.”
Reply (Edit)
Hi,
I am also getting the same error.Can any one suggestions on it?
Reply (Edit)
Reply (Edit)
I am going through the POM and I don’t see a section in POM which could be mapped to libraries / project referenced by Application. I am still not
able to figure out that part. POM might work for stand-alone Application. However that is not a case for IIB applications. It always has a java
application or library referenced. Could you please help me to understand ?
Reply (Edit)
Reply (Edit)
I have configured a jenkins job to stop and start integration node on daily bases for maintinance purpose .
Here the issue is mqsistop is happens successfully , i.e., integration node is stopping but mqsistart is not woring fine with jenkins jobs can any one
help on this ??
Reply (Edit)
Reply (Edit)
Hi Manmadhainfra,
I am able to stop and start integration nodes from Jenkins job successfully. Please share logs of the Jenkins job so that I can look at it.
Reply (Edit)
I have checked the install software list and I see the plugin are installed of the same version you mentioned.
Thanks in advance.
Reply (Edit)
Excellent post.
I have some doubts, for example:
Could maven manage static/shared libraries?
Is it possible to use iib-maven-plugin with IIB Toolkit in docker?
Reply (Edit)
Though I have not tested the pluginiib-maven-plugin with IIB toolkit in docker; however I believe it should work.
Reply (Edit)
For example, in the case of Java-Maven, Maven can download dependencies and libraries (.jar) from an Artifact Repository (Maven
Central, Artifactory or Nexus).
However, in the case IIBv9 and IIBv10, when you unzip a Bar file, you can see that the libraries are in .libzip format.
Is Maven compatible with this type of extension when using maven install/maven package? and if this is possible,
Could mqsicreatebar create a bar file using this .libzip format and without libraries source code?
About IIB toolkit in docker, I’ll try, although I must make some changes in the plugin.
Reply (Edit)
Reply (Edit)
Reply (Edit)
AnandAwasthi February 28, 2019
Hi,
The error appears to be related to the workspace where you are building the project. Can you share below info so that I can take a look:
1) POM file of your project
2) If you are building from Jenkins, what have you set for ‘workspaceDir’ and ‘buildsDir’
Reply (Edit)
Hello, great post! Are you planning on doing something similar for ACE? I would love to use Maven for ACE builds, but I would think that the v10 plugin
will not work..
Reply (Edit)
Reply (Edit)
Reply (Edit)
Also, for compiling v10 project, add one more parameter in your project POM specified in step 4 here.
%IIB 10 install location%\server\bin
Regards,
Anand
Reply (Edit)
Reply (Edit)
Please do provide the information I asked so that I can see the issue you are facing.
Reply (Edit)
Reply (Edit)
Thanks,
Anand
Reply (Edit)
Hi Anand Aswathi,
I am getting below error when executing “mvn clean install”. do need to setup any config before running the mvn install.
D:\DevOps\iib-maven-plugin-v10\iib-maven-plugin>
Reply (Edit)
Hi Anand Aswathi,
I am getting below error when executing “mvn clean install” . are there any dependencies or config settings before build.
D:\DevOps\iib-maven-plugin-v10\iib-maven-plugin>
Reply (Edit)
central
Central Repository
RepoPath/url>
false
central
Central Repository
RepoPath
false
nexus-release
Corporate Repository
RepoPath
default
4) If you are going to check-in the source code into your source control repository and make maven release, you need to update below
section with source control url for the plugin source code. You can safely ignore it if you are building locally. Below is an example for svn:
Thanks,
Anand
Reply (Edit)
Reply (Edit)