Jenkins Tomcat

broken image


  • Jenkins Tutorial

Add in the Jenkins post-build action for Tomcat. To configure the credentials, you must click the Add button next to the empty entry field and create a new Jenkins credentials object: Jenkins credential used by the Deploy war/ear to a container plugin.

  • Jenkins Useful Resources
  1. Jenkins is the Way! We are looking for experiences of Jenkins users from around the world showcasing how they are building, deploying, and automating great software with Jenkins.
  2. Tomcat deploy transfer speed (JENKINS-40428) Add support for Jenkins Pipeline (JENKINS-44810) Allow expansion of environment variables in the configuration (JENKINS-12825) Version 1.13 (August 7, 2017).
  • Selected Reading

The following prerequisites must be met for Jenkins Tomcat setup.

Step 1: Verifying Java Installation

To verify Java installation, open the console and execute the following java command.

Jenkins tomcat 10
OSTaskCommand
WindowsOpen command console>java –version
LinuxOpen command terminal$java –version

If Java has been installed properly on your system, then you should get one of the following outputs, depending on the platform you are working on.

OSOutput
Windows

Java version '1.7.0_60'

Java (TM) SE Run Time Environment (build 1.7.0_60-b19)

Java Hotspot (TM) 64-bit Server VM (build 24.60-b09, mixed mode)

Linux

java version '1.7.0_25'

Open JDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64)

Open JDK 64-Bit Server VM (build 23.7-b01, mixed mode)

We assume the readers of this tutorial have Java 1.7.0_60 installed on their system before proceeding for this tutorial.

In case you do not have Java JDK, you can download it from the link Oracle

Step 2: Verifying Java Installation

Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example,

War Tomcat

OSOutput
WindowsSet Environmental variable JAVA_HOME to C:ProgramFilesjavajdk1.7.0_60
Linuxexport JAVA_HOME=/usr/local/java-current

Append the full path of the Java compiler location to the System Path.

Jenkins tomcat 10
OSTaskCommand
WindowsOpen command console>java –version
LinuxOpen command terminal$java –version

If Java has been installed properly on your system, then you should get one of the following outputs, depending on the platform you are working on.

OSOutput
Windows

Java version '1.7.0_60'

Java (TM) SE Run Time Environment (build 1.7.0_60-b19)

Java Hotspot (TM) 64-bit Server VM (build 24.60-b09, mixed mode)

Linux

java version '1.7.0_25'

Open JDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64)

Open JDK 64-Bit Server VM (build 23.7-b01, mixed mode)

We assume the readers of this tutorial have Java 1.7.0_60 installed on their system before proceeding for this tutorial.

In case you do not have Java JDK, you can download it from the link Oracle

Step 2: Verifying Java Installation

Set the JAVA_HOME environment variable to point to the base directory location where Java is installed on your machine. For example,

War Tomcat

OSOutput
WindowsSet Environmental variable JAVA_HOME to C:ProgramFilesjavajdk1.7.0_60
Linuxexport JAVA_HOME=/usr/local/java-current

Append the full path of the Java compiler location to the System Path.

OSOutput
WindowsAppend the String; C:Program FilesJavajdk1.7.0_60bin to the end of the system variable PATH.
Linuxexport PATH=$PATH:$JAVA_HOME/bin/

Verify the command java-version from command prompt as explained above.

Step 3: Download Tomcat

The official website for tomcat is Tomcat. If you click the given link, you can get the home page of the tomcat official website as shown below.

Browse to the link https://tomcat.apache.org/download-70.cgi to get the download for tomcat.

Go to the ‘Binary Distributions' section. Download the 32-bit Windows zip file.

Then unzip the contents of the downloaded zip file.

Jenkins Tomcat Logs

Step 4: Jenkins and Tomcat Setup

Copy the Jenkis.war file which was downloaded from the previous section and copy it to the webapps folder in the tomcat folder.

Now open the command prompt. From the command prompt, browse to the directory where the tomcat7 folder is location. Browse to the bin directory in this folder and run the start.bat file

Once the processing is complete without major errors, the following line will come in the output of the command prompt.

Jenkins Tomcat Deploy

Open the browser and go to the link − http://localhost:8080/jenkins. Jenkins will be up and running on tomcat.





broken image