Tuesday 21 June 2016

Building Artifacts Using Jenkins

Building Artifacts Using Jenkins

Often we deal with Maven based projects with multiple modules and Jar files, that are managed using different Maven Projects having their own Pom.xml.
This blog post guides how to configure such project on Jenkins.
I would strongly recommend you to go through my earlier post on Jenkins as that covers Jenkins Installation, WAR file building and  deployment to tomcat. Automation deployment using Jenkins
Below is the problem statement that we need to address :
Our Project is a dynamic web project
We have configured it for the deployment to the tomcat using Jenkins, but it fails to find child.jar that is managed by its own Pom.xml having its own SVN repository.
How we will resolve it :
We will create a separate job that will create this jar and copy it to the local maven repository (Maven repository of machine on which jenkins is running).
Upon successful copy of the artifacts this job will trigger another job of jenkins that is for the build and deployment of the war file in context.
Below are the steps for creating the Job that will create Jar and Trigger the Job for the deployment of WAR.
Steps to create the job
1  Click on create new job.
2  In the “Source Code Management” section enter the SVN url of the Jar Project.
3 In “Build Section” enter mvn params in Goal and Install option eg : clean install.
4 Click on button “Post Build Action”, select “Build another project option”, Enter the name of the project that you want to build upon successful packaging of the Jar.”
T2 Config [Jenkins] 2013-07-16 14-28-12

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home