Java Tech Updates

Java Tech Updates

  • Blog
  • Code
  • NEWS
  • About Us
  • Contact us
  • Privacy
  • Write for us
Home  /  Blog  /  How To Use Jenkins Web Based Build Management Tool In Java Applications?

How To Use Jenkins Web Based Build Management Tool In Java Applications?

Vijay July 22, 2016 Blog 3 Comments

In this post, java application development experts will discuss Jenkins web-based build management tool and its requirement in developing projects. You can read this post and learn how to install Jenkins and make the best use of this management tool.

Introduction:

The necessity of build tool is to integrate the source code properly which are developed by many people for a single project. Each developer works on different modules from the same code base, so frequently the code gets updated.

The build management tool responsibility is to take the latest version of the code from the repository and produce the new version of Project.  The good features of Jenkins are we can use any build tool and version control. For example, if you are using ANT based build tool, we can configure ANT in Jenkins for your project build process.

If your project is using Maven based build, you can configure Maven for your Project. Similarly, you can set up any version control which is available from Jenkins. You can use CVS, SVN, and GIT, etc.  So, The Jenkins is not live with one particular tool, based on the project requirement, we can customize the Jenkins.

I will be explaining the following things in this article.

  1. Jenkins installation steps.
  2. Creating Project in Jenkins
  3. Integrating Maven build tool in Jenkins
  4. Building project using Jenkins.

Jenkins installation steps

Go to following official website for Jenkins

https://jenkins.io/

Once you click download button it will prompt the following window

1

Click the LTS release which is stable you will get the installer file from the download. Double click on the installer and follow the steps to install you will see the following steps to install it successfully.

2

After successful installation following folder should create in your windows S.

<Your drive>:\Program Files (x86)\Jenkins

Following path, you can see a Jenkins.war.

C:\Program Files (x86)\Jenkins

Copy Jenkins war file to your tomcat location of web app folder. Start the tomcat server by clicking the startup.bat file. After starting the server, you can see the Jenkins related logs in the server console without error. It means Jenkins deployed in the server successfully.

3

In the webapp folder you can see the Jenkins folder which is extracted from Jenkins.war.

4

Use the following URL to get Jenkins home page in your local.

http://localhost:8080/

This URL gives the home page of Jenkins as in the below screenshot.

Now, we have installed Jenkins in our system and it is running successfully.

5

Creating Project in Jenkins

Creating Project means you are creating a building management Project for your existing Java Project.

Click “create new jobs”. It will show the following screen.

6

Select the Maven project and enter the project name. Here I have entered as “java-spring-maven” then click ok. Next, it will ask you to enter project settings for “java-spring-maven” as in the screenshot.

7

Add some description of the project as in the screenshot.

8

Select source management as none because I have not used any source management.

9

Enter pom.xml file path in the Root POM text field and enter the maven Goals as in the screenshot. The pom.xml file path should be from your Java project folder. In this example, I am using java-spring Project which is coming from “F:\Work\example-workspace\java-spring”. Create simple maven based project using eclipse and share that pom.xml file in the field as in the above screenshots.

10

If you want to get email notification while build failure, select the “E-mail Notification” checkbox and enter a valid email as in the screenshot.

Once you entered all, click the Save button and the following screen will appear.

11

12

Till now we have integrated maven build tool in Jenkins for a java based maven Project.

We have configured maven build tool in our project and the next step is we need to add JDK and maven in Jenkins to run the build.

Click manage Jenkins, you will get the following screens.

13

Click Configuring system
Click Add JDK Button as in the screenshot

14

Once you click “Add JDK” following section will appear.

15

Deselect install automaticallycheckbox. Once you have done that, the following section will appear.

16

Enter your Java version name in JDK Name field and enter your java home in JAVA_HOME field as in the screenshot.

Now we need to give maven information as following. Click Add maven button as in the screenshot.

17

Once you click, following section will appear.

18

Unselect “install automatically” checkbox. You will get the following section.

19

Above section, you need to enter maven name and maven home as in the screenshot below.

We have entered the JDK details and Maven details. Now click save button. Once it saved successfully following screen will appear.

The screen shows the Project details. Click on the project name. Once you click it, navigate following screen where it says about the Project information.

20

21

We have completed the build setup. Now, this is a time to build the application using Jenkins. Click the “Build Now” link inside navigation bar as in the above screenshot. Once you click “Build Now” link, your project build will start and shows a progress bar as in below screenshot.

22

If a build is completed the progress bar will disappear. Now click #1 link, it will show the build details as in the screenshot.

23

As per the above screenshot, we have completed one build successfully. If you want to see the build log click “Console Output” in the side navigation bar. It will show the build log as in the below two screenshot.

24

25

26

Click “Back to Project” from the side navigation bar.

Once you click, you will be navigated to project home page as in below screenshot

27

If you see highlighted red color box, it shows the build details such as build happened time and how the build went whether success or failure, etc. This is showing that our build is a success.

If you click “#1”, it will go to following details page.

28

The ‘Module builds” showing as java-spring. It is our java project name. WhenI set pom.xml path in the project settings, I have pointed out the pom.xml file which belongs to “java-spring” if don’t remember, go back and check the project settings in the document.

When click “Java-spring” link, following screen will appear. This shows generated war file for our deployment which is java-spring-0.0.1-SNAPSHOT.war

29

Hope this article will help you in making the best use of Jenkins tool in java application development. If you did not understand anything, contact professionals and ask your doubts. You can leave your feedback for this post in your comments.

Tags: Java, java application development, JDK, Jenkins, Spring, Web Based Application
Previous Article
Next Article

About Author

Vijay

Related Posts

  • Employee Performance

    Mobile & PC Screen Recorder to Measure Employee Performance

    March 18, 2019
  • Social Media Strategy

    Why Animated Video is a Best Strategy for Your Social Media

    March 4, 2019
  • Java anomaly detection tool

    Top 5 Java Anomaly Detection Tools

    February 14, 2018

3 Comments

  1. devops online training Reply
    March 21, 2017 at 4:32 am

    Oh my goodness! Incredible article dude! Many thanks. 

  2. MaxCure Hospitals Reply
    December 28, 2017 at 9:32 am

    Jenkins installation made easy with this post.

  3. Pingback: Is Java the Missing Link Between IoT and Future Application? - Java Tech Updates

Leave a Reply

Cancel reply

May i Help You !

    Your Name (required)

    Your Email (required)

    Subject

    Your Message

    Popular Posts of The Month

    • Java developers Team
      Essential APIs access could be critical with Java 9 October 22, 2015
    • Java development with JRebel & XRebel
      JAVA introducing the two diodes in this language November 19, 2015
    • How To Use Jenkins Web Based Build Management Tool In Java Applications? July 22, 2016
    • Programmers And Developers Need To Wait More For Java 9 December 10, 2015
    • Attractive features in Java SE 8u 40
      Attractive features in Java SE 8u 40 November 9, 2015
    • Java 9 releases by JPI
      New access program for supporting Java 9 releases by JPI November 25, 2015
    • Java Application Development Composure Of Miniprograms February 9, 2016
    • IOT and Java
      Is Java the Missing Link Between IoT and Future Application? February 1, 2017
    • Java Programmers And The Joy Of Application Development May 11, 2016
    • Java
      Tutorial Alert: Chain of Responsibility Pattern With JAVA September 16, 2016
    • Java Outsourcing
      Spring Data Rest – Repositories August 23, 2016
    • PROFESSIONAL JAVA DEVELOPERS
      How To Become Professional Java Developers? March 16, 2016
    • spring-factory-beans
      How to Use Spring Factory Beans in Java Development January 4, 2017
    • cross-culture-business-communication
      The Why and How of Cross-Cultural Business Communication November 8, 2016
    • scala-development-by-javaprofessionals.net
      Scala Development Vs Java- A Never Ending Debate January 1, 2016
    • java outsourcing india
      Top Reasons To Consider Java Development Outsourcing To India August 4, 2016
    • Java Software Development
      JPI To Offer Rapid Deployment Package To Java Development Teams December 21, 2015
    • java application development
      Java App Development Using Hibernate December 10, 2015
    • Java developers Team
      MyEclipse 2015 Updates for Java Developers December 7, 2015
    • cache management in java
      Cache Management in Java – Caching Techniques June 11, 2016

    Recent Posts

    • Employee Performance
      Mobile & PC Screen Recorder to Measure Employee Performance March 18, 2019
    • Social Media Strategy
      Why Animated Video is a Best Strategy for Your Social Media March 4, 2019
    • Java anomaly detection tool
      Top 5 Java Anomaly Detection Tools February 14, 2018
    • Java development
      2017, stayed a big year of Twists in Java Development, Must Watch! February 9, 2018

    What Others Are Reading

    • Java development copmany
      Spring Retry framework for Better Java Development January 19, 2017
    • Java
      What are The Big Benefits of Java Enterprise Development? November 24, 2016
    • Angular 2 for Java
      Angular 2 For Java And Python – A Review By Java Outsourcing Vendor May 5, 2016
    • Powerful CRM
      Getting your PhD Ready for Proofreading? August 9, 2017

    Random Posts

    • Future of Big Data
      The Future of Big Data IOT-Internet of Things June 15, 2017
    • Programmers And Developers Need To Wait More For Java 9 December 10, 2015
    • Angular 2 for Java
      Angular 2 For Java And Python – A Review By Java Outsourcing Vendor May 5, 2016
    • JHipster – The Latest Tool by Java November 10, 2016

    Popular Posts

    • Java developers Team
      Essential APIs access could be critical with Java 9 October 22, 2015
    • Java development with JRebel & XRebel
      JAVA introducing the two diodes in this language November 19, 2015
    • Attractive features in Java SE 8u 40
      Attractive features in Java SE 8u 40 November 9, 2015
    • Programmers And Developers Need To Wait More For Java 9 December 10, 2015
    Theme by Dashing Themes | Proudly Powered by WordPress