Java Software development company

Build Automation using Jenkins

Posted on Updated on

Technology: Jenkins is the most powerful and most preferred to use application for continuous integration, and continuous delivery of projects. As Jenkins is web application download and deploy Jenkins on any web/application server, and it can run on any platform independent of operating system. Integrate Jenkins with majority build tools like Ant, Maven, and Gradle. Jenkins provides plugin to interact with version control systems like Git, SVN, and Mercurial etc…

Importance of Jenkins:
Jenkins tool is used for continuous integration, Jenkins will prepares build whenever a developer commits to code to shared repository, and the latest build can handover to testing team for Quality Analysis. This will remove the problem of finding later occurrence of issues in build life-cycle. The common practice is that whenever a developer commits the code, Jenkins will start the build process.

The workflow will like below:

0

Setup Jenkins:

Either download war file from Jenkins site (https://updates.jenkins-ci.org/latest/jenkins.war) or Install exe file for windows from location (http://ftp-chi.osuosl.org/pub/jenkins/windows/jenkins-2.59.zip), Extract and install executable file.

It will create a windows service for serving Jenkins application.

If we download war file, start the Jenkins using java –jar jenkins.war command. After the command is run, different program will run, one of which is the withdrawal of the war file which is complete by an embedded webserver called winstone.

After successful message browse the link http://localhost:8080 to access Jenkins.

The default password will be stored in initialAdminPassword which is in secrets folder of Jenkins installation directory. Modify the password after login.

Installing Plugins for Jenkins:

Navigate to http://localhost:8080/pluginManager/available to see all default available plugins for Jenkins.

Select the plugins to install.

1

After the successful installation we see the below screen:

3

We need to setup the JDK and Maven in Jenkins: Navigate to Configure Tool Page:
http://localhost:8080/configureTools/

4

Similarly Install “GIT server Plugin” plugin and using configuration tool page configure the Git.
Automated Deployment to Application Servers: they are many plugins available to move the build to application server deployment location, for example we can use Deploy to container Plugin to do automatic deployments.

5

The plugin takes war/jar/ear file from build and deploys to running instance of the application server.
Jenkins –Setup Build Jobs:
From Jenkins Home page, create jobs, after clicking create new job it will navigate to below page.

6

Where we can specify Job name and select type of the project for example Maven Project.
After clicking on ok button, we see the below screen. Where we can configure the Git Repository details.

7

And Build steps, choose Invoke top-level Maven targets and specify the maven goal for project.
After entering all the details save job.

8

Click Build Now in left side Menu to trigger the build.

9

Build History Job instance is created and monitor the progress of the job.
Once the build is completed, a status of the build will show if the build was successful or not. This case, the instruction developed has been executed successfully. Click on the #1 in the Build history to bring up the details of the build.

10

By clicking on Console Output link to see the details of the build.

11

Distributed Builds: Some times more than one build machines are required for heavier and larger project build on regular projects, running on all jobs on same node is not best option. We can configure the Slave machines which will take load from master node so that load on master node will be reduced.

Sometimes we need several different environments to test builds, in this we can create a slave for each environment. Some jobs may need to run the multiple nested jobs to complete job, if nested jobs are independent like running on job on windows, Ubuntu etc… then we can run each nested job on different slave parallel so that build time can be minimized.

A slave computer is set up to take offload build projects from master node, once setup is completed distribution is automatic. Add label to each slave server, based on setup stick to one slave server and pick a slave server from label.
Since each serf runs a particular program called a “slave agent” there is no need to install the full Jenkins (package or compiled binaries) on a slave. There are various ways to start slave agents, but in the end the slave agent and Jenkins master needs to establish a bi-directional communication link (for example a TCP/IP socket.) in order to operate.

1) We need to navigate to Manage Jenkins Section.

12

2)  Click on New Node.

13

3) Enter Name and select the checkbox.

14

15

4) By default the newly created machine will be in Offline initially, once it validate the fields which we enter previously, if validation is success it will come to online state, but user can move slave machine to offline.

16

Jenkins also provide Code coverage plugin which will collect information Source Code Analysis reports like CheckStyle, Find Bugs, and PMD etc…
Source Code Analysis Collector is Jenkins plugin which will combines the individual results of these plugins into a single trend graph and view.
The plugins can provide information such as

  • The total number of warnings in a job
  • A showing of the new and fixed warnings of a build
  • Trend Reports showing the number of warnings per build
  • Overview of the found warnings per module, package, category, or type
  • Detailed reports of the found warnings optionally filtered by severity (or new and fixed)

Conclusion: Jenkins is Continuous Integration tool, using which we can automate build process, deployments, code analysis, etc.., Jenkins have large number of variety plugins for each of the operation, and we also monitor the status of Jobs. If project contains many modules we also creates nodes for Jenkins for load distributions, it is one of the J2EE application and Java Software Development Company, we can deploy on any application server on any environment.

 

Java and .NET: Competitors or Allies?

Posted on

You would have read plenty of material comparing Java and .NET and also advising you on which one to choose. The fact is that both Java and .NET perform similar functions. There is no doubt that they are competitors, but, unlike how some bloggers project them as opponents with diverse interest, these are competitors with same interest.

In this blog, I will attempt to touch the common points between the two and leave the selection decision on you without maneuvering facts and making one look better than other.

Java and .Net

Understanding Java
Java is a programming language and just when you start relating to it as a language, you will encounter the Java Framework, the Java Platform, and a lot of Java everywhere. Although, all of these are linked with a thin line of difference, but, for a beginner with no prior knowledge, it might be confusing at first. In this blog, we are talking about the Java Platform that use Java as the core programming language.

Understanding .NET
.NET is a Microsoft-powered framework. The primary languages are C# and VB.NET. It has been in existence for close to two decades and has emerged as a tough competitor to Java which had a kind of a monopoly before .NET was launched. This is sometimes confused with ASP.NET which is an application framework whereas .NET is a programming framework.

Common Points
The basic purpose of both Java and .NET is same. The commonalities can be broadly classified on the basis of the purpose and convenience. Let’s look at each of these in detail.

  • The Purpose Is to Develop Applications :- Both Java and .NET are used for developing server-wide applications. These are often referred to as object-oriented languages that involves using classes which can later be used for incorporating similar functions in different applications. Again, to emphasize for Java Platform, the language for writing codes in Java and in .NET it is primarily C#. Java and .NET can be used to create applications for different platforms. There are reservations here like .NET being preferred to Windows applications but then nothing like a hard and fast rule.

    You can easily get started with the development by either employing a Java or .NET developer or by collaborating with a .NET or Java Software development company.

  • The Aim Is to Avoid Rework :- You guessed it right, this is about modularity. While this is something not to boast about because almost all the application building platforms are now modular, it does add to the convenience aspect that a developer gets by being able to reuse classes and use plugins from external sources. The comfort of a developer is a prime point in determining which language will be chosen. And, therefore, the companies focus on this aspect.

This also involves the availability of help resources. Many a times, Java developers advocate for Java being a better choice because it is easy to find a Java Software development company. But, this is not true. There are almost the same resources available for help irrespective of which platform you choose.

Conclusion
Java and .NET are indeed competitors but another point of looking at them is to consider them as allies that motivate each other to develop something more innovative which gives one edge over the other. If either of these is eliminated from the equation, it would be a one-sided battle (not literally) without any motivation for the other. Both have their set of pros and cons, lovers and haters, which encourage the platforms to go strong against each other. Let us know which one you choose.