Jenkins-Day-6 || Building simple project using Java 17 version + Maven 3.8.7
Rajesh-Devops2023-01-14
1K views|1 years ago
💫 Short Summary
The video segments discuss the importance of Maven as a build tool for Java developers, highlighting the process of setting up dependencies, matching Java and Maven versions, and troubleshooting common issues. The segments also cover the significance of server configurations for Jenkins, project management, and the central repository for accessing necessary libraries. Additionally, they address setting up environment variables, compiling and packaging code, handling remote repositories, and building projects within Jenkins. The overall focus is on optimizing project efficiency, ensuring compatibility, and enhancing development processes through proper configuration and management.
✨ Highlights
📊 Transcript
✦
Importance of Maven in resolving dependency issues for Java developers.
00:41Maven automatically downloads necessary libraries during project building, eliminating manual handling.
Selecting appropriate server configurations for Jenkins is crucial, with industry standards favoring high-performance servers with large RAM, storage, and multi-core CPUs.
Efficient project building is achieved through proper server configurations in Jenkins.
✦
Utilizing Jenkins for project management in a company.
03:45Emphasizing the need for a large server to handle multiple projects simultaneously.
Importance of selecting the appropriate server type like T2 dot medium for cost efficiency.
Demonstrating server setup, login procedures, project structures, and Maven for Java programs.
Focus on server configuration, project management, and optimizing server usage.
✦
Maven as a crucial build tool for downloading project dependencies.
08:24Maven central repository is the main site for Java developers to access necessary libraries.
Importance of dependencies and how to add them to the pom.xml file.
Google's Goa Library as a popular set of libraries.
Detailed explanation of accessing and adding dependencies from the Maven repository.
✦
Setting up dependencies in a project involves installing Maven and Java.
12:27The narrator demonstrates the steps to install Maven using commands and check the Maven version.
An error related to Java version prompts an upgrade to Java 17.
Running a Java alternative command is necessary to switch to Java 17.
Using the correct Java version is crucial for successful compilation of project dependencies.
✦
Importance of matching Java and Maven versions for successful compilation.
16:42Using Java 17 and Maven 3.3 together is crucial, as issues can arise with Java 17 and Maven 3.6.
Solution involves downloading the correct Maven version, like 3.8, and ensuring compatibility with the Java version.
Understanding system requirements is key, and downloading source code may be necessary for proper installation.
✦
Installation of OpenJDK 16 and Apache Maven.
21:55Compatibility issues with Java version 3.8.7 are encountered during installation, resolved by installing OpenJDK 16.
Errors in dependencies in the pom.xml file lead to compilation failures.
Spelling mistakes in the file are identified and corrected to ensure successful compilation.
Presenter demonstrates troubleshooting methods and emphasizes the importance of proper configuration for smooth compilation processes.
✦
Troubleshooting error related to Maven compiler property tag placement.
28:17Adjusting tag positioning resolved the issue with the Maven compiler.
Downloading dependencies for the project, such as Goa libraries and hibernate core relocation Library for database communication, was discussed.
Emphasis was placed on the importance of correct library usage and connection to databases during the troubleshooting process.
✦
Adding Dependencies to a Project with Maven.
30:42Centralized repositories like mvnrepository.com are crucial for easily downloading necessary libraries for projects by specifying dependencies in the pom.xml file.
The segment discusses the use of different build tools like Gradle and Kotlin to meet specific project requirements.
Emphasizes the convenience and efficiency of using external dependencies from centralized repositories for various development tools and projects.
✦
Benefits of setting up remote repositories for Java developers.
32:50Centralized approach prevents developers from connecting to external sources during project work.
Remote repository within organization's boundaries contains all project dependencies for internal access.
Clean room concept enforces project development within company's network, reducing risk of external connections.
Developers can securely access required dependencies and start project work without compromising security.
✦
Overview of remote repositories, compiling code using Maven, and setting up environment variables in Linux.
35:50Explanation of methods such as export commands, creating environment files, and adding shell scripts.
Emphasis on the importance of setting variables for system environments, with specific instructions for Ubuntu users.
Demonstration of exporting a variable name and value in the Linux environment.
✦
Setting environment variables in Java through 'Etc profile dot d' file.
39:38Demonstrates using export commands to set Maven path and adding it to existing variables.
Saving the file, logging out and in to reflect changes for Maven 3.8.7 and Java 17.
Emphasizes the importance of logging out and in after setting variables to ensure changes take effect on the server.
✦
Explanation of Maven compilation and packaging process.
44:14'mvn compile' compiles the code, 'mvn package' compiles, tests, and generates a package like JAR or WAR.
Running 'mvn package' command creates a Target directory with the package file.
Executing the application by running the JAR file with 'java -jar'.
Emphasizing the importance of following the sequence of compiling and packaging for successful build processes.
✦
Compiling a Java project involves running unit test cases and building a package using Maven commands.
47:14Running 'mvn package' internally compiles, tests, and packages the code, generating jar, war, or er files in the target directory.
'mvn clean' command removes the target directory and compiled files.
Maven goals or build phases can be achieved by running a sequence of commands.
Higher versions of Maven can be downloaded from the Maven site for access to more features.
✦
Manual installation of Maven 3.2 when it is not available in the package repository.
51:00Developers should download the Maven 3.2 archive from the official site and set it up manually.
This approach is commonly used when specific versions are not provided by the distribution.
The process involves downloading the Maven 3.2 archive, extracting it, and setting up the environment.
Developers may need to install Maven 3.2 through the source code to work with the desired version.
✦
Importance of Matching Java and Maven Versions for Successful Code Compilation
55:15Matching the Java and Maven versions used by developers is crucial to prevent build failures.
Mimicking the developer's environment is key to ensuring successful code compilation.
Mismatched versions can lead to project build issues and software incompatibilities.
Following the developer's version recommendations is essential for a smooth build process and project compatibility.
✦
Steps for downloading, compiling, and packaging the Spring Pet Clinic open-source project.
56:30Access the GitHub repository, clone the project, and use Maven to compile the code.
Dependencies are downloaded based on the pom.xml file, including Java 17 and Spring Framework components.
Successful build results in the creation of class files in the Target directory.
Emphasis on setting up and compiling the project for further development and testing.
✦
Running tests on a Java Spring project.
01:01:39The process includes compiling, running unit tests, and checking the test results in the Surefire reports directory.
Steps demonstrated include cloning the project, compiling with 'mvn compile', and running tests with 'mvn test'.
Importance of checking the test results in the Surefire reports directory is emphasized for successful unit tests.
The segment offers a detailed guide on validating and analyzing test results in a Java Spring project.
✦
Overview of Maven commands, with a focus on 'mvn package'.
01:05:48Running 'mvn package' compiles and packages code, creating a jar or war file in the target directory.
Running the jar file using 'Java -jar' command to execute the application.
Emphasis on the importance of having the palm.xml file in the correct directory for Maven commands to work effectively.
✦
Setting up a Spring Pet Clinic application.
01:07:35The process includes running the application on a dummy server, downloading dependencies from the Maven repository, and storing them in the user's home directory under the .m2 folder.
Emphasis is placed on the importance of organizing and keeping Maven repositories easily accessible for different users.
Each user has their own repository structure to efficiently manage dependencies.
The segment offers a detailed guide on handling dependencies in a Spring application development environment.
✦
Setting up Maven and Java on a Jenkins server.
01:11:00Creating a maven.sh script to set up paths and variables using profile.d.
Importance of these steps for the project's dependencies.
Demonstrating copying and pasting commands for setting up the environment on the server.
✦
Setting up a project in Jenkins for building a Spring Pet Clinic project using Java 17 and Maven 3.8.7.
01:16:05Creation of a new project in Jenkins, specifying project details, selecting a Git repository, and setting up build configurations.
Configuration of build steps, execution of Maven commands, and saving the project.
Future sessions will delve into advanced topics such as build environments and triggers.
Emphasis on simplicity in building the Spring Pet Clinic project within Jenkins.
✦
Troubleshooting cloning a Git repository and finding environment variables in Jenkins.
01:19:52Speaker explains steps to locate missing variables and offers solutions.
Emphasis on system configuration settings and security measures in Jenkins for interviews.
Managing credentials and the crucial role of system configuration in Jenkins operations.
✦
Highlights on Configuring Global Security Settings and Maven Package Issues.
01:22:31The segment covers important considerations for global security settings and permissions during interviews.
Specific questions related to security settings and permissions may be asked in interviews.
Steps to troubleshoot and fix Maven package issues in a project by adjusting configurations are provided.
Correctly setting up Maven configurations is emphasized for ensuring project functionality.
✦
Building and Running a Project with Maven in Jenkins.
01:25:42The video demonstrates creating a new project by copying content from an existing one.
Following specific steps and configurations in Jenkins is crucial for successful project creation.
Proper setup and organization within the Jenkins workspace are essential for effective project management.
✦
Setting up Maven target in Jenkins.
01:29:06The Maven target option is available in Jenkins due to installation of selected plugins during Jenkins installation process.
Speaker demonstrates setting Maven version and configuring top-level goal before saving and applying changes.
Process involves building project using Maven, with successful outcome shown in demo project.
Importance of correctly setting up Maven path and configuration in Jenkins for successful project builds.
✦
Importance of understanding basic concepts for grasping further Jenkins topics easily.
01:32:45Encouragement for clarity in learning to feel comfortable with upcoming classes.
Session continuation the next day at 10 pm with a plan for future classes outlined.
Viewers advised to connect for further learning opportunities and watch recordings if needed.
Speaker expresses willingness to continue teaching and ensures support for those facing difficulties in understanding.
00:03okay guys thank you so good evening guys
00:07uh so let us you know continue our
00:09Jenkins session so we would be
00:11continuing our Jenkins uh day six if I'm
00:15not wrong right
00:16day succession one second let me uh
00:19check verify one more time yeah basic
00:21session
00:32so in the last session like we had just
00:36you know like try to understand the
00:38maven building we started with the with
00:41understanding what is the maven so Maven
00:43is basically a build tool and before
00:45Maven we had an ant tool right so ant
00:47tool was also uh developed by the Apache
00:50organization right Apache software
00:52Foundation organization right but as I
00:54said earlier in our and trade ant was
00:57having lot of limitation it was not able
00:59to download the dependency what it
01:01requires Java because Java later what
01:04happened it was once the Java started
01:06flourishing right there were a lot of
01:07open source project Java open source
01:09project started coming up so hence what
01:11happened many of the community
01:12communities around the world what they
01:14started doing they started developing a
01:16lot of libraries right and one of the
01:19very important Library we know is a
01:21spring boot actually so we have a
01:22basically we have a spring boot you know
01:24like framework is there so through which
01:26what happened right you were you were
01:28able to design a lot of java based
01:30applications Java requires a spring boot
01:32uh Frameworks and all so hence what
01:34happened right whenever you want to
01:36whenever a Java developer is developing
01:38a a spring boot framework right or the
01:41spring boot up related application right
01:43he needs a lot of libraries so those are
01:45all kind of a dependent Library
01:46dependency which the Java developer
01:49requires so so what happened right so
01:52that's the reason what happened Apache
01:53software Foundation they come up with
01:55this Maven tool and with the help of a
01:57maven tool we are able to you know like
02:00download all kind of a dependencies
02:01during building of the project
02:03right so the Java developer need not to
02:06worry about the dependency automatically
02:08the maven Bluetooth will download all
02:10the necessary libraries all dependencies
02:11whatever it is required during
02:13development of the project
02:15so that's what we had discussed in the
02:16last session so what we are going to do
02:18today we will be continuing from there
02:20itself actually so if you remember uh I
02:24think let me log into my AWS console so
02:31yeah so let me log into the AWS console
02:33guys so
02:36this is my account one of my account
02:37other account
02:38and
02:40we're logging into my AWS console
02:44let me check what are the machines I
02:46have I remember I had some two servers
02:47one is a Jenkins server and other is a
02:50some kind of a dummy server I had
02:52created I remember so if you go to the
02:55instances
02:57yeah these are two servers I have it has
02:59been stopped straight and also I
03:01remember like I had changed the instance
03:02right because it was T2 dot micro medium
03:05so as I said earlier like whenever you
03:07are uh like whenever you're confident in
03:09Jenkins server right it is always better
03:11to go with a little higher configuration
03:12because like you will be building lot of
03:14projects so Jenkins uh you know
03:16conference should be little high right
03:18if you go to Industry they'll be using a
03:20lot of big servers like a T2 dot extra
03:22large they're losing where they'll be
03:24having a 16 GB or 32GB RAM and the hard
03:27disk will be like a 500gb or one
03:29terabyte hard disk okay and it will be a
03:32multi-core CPU like uh 64 core CPU like
03:36that very big servers they'll go with
03:38whenever they are working with the
03:39Jenkins shop because Jenkins has to
03:41handle multiple different projects so
03:43it's not one or two teams hundreds of
03:45teams are there in the company where
03:46they'll be using a centralized Jenkins
03:49service that we call as a unified
03:50Jenkins so there what happened you need
03:52a very large server very big server
03:54which can handle multiple you know
03:56project Exhibition at the same you know
03:58time actually right so here what
04:00happened right we will go with the t2
04:02dot medium but T2 dot medium is a
04:03chargeable hence I converted the
04:05instance type so let before I start the
04:07Jenkins server let me change instant
04:09Stuff how to do it just click on this
04:12and go here actions go to the instance
04:15settings go to the change instance type
04:17here guys you just try to search for
04:20various D2 dot medium you need not to go
04:22for T2 large and extra large it is not
04:24required because the billing is little
04:25too high so go with the minimal T2 dot
04:28medium if you select the tutor dot
04:29medium and if you make it run you know
04:31that per hour it will charge around 8
04:33rupees so but that is fine for us now
04:36eight rupees for me it's okay fine it
04:38sounds like if I go to some install
04:40outside right if I have a t it will be
04:42eight or ten rupees nowadays right so
04:43spending one hour or two hours for me
04:45it's not a big thing so let me start
04:47this instance so today dot medium is
04:49instance type and I'm making the server
04:51up similarly let me make even this dummy
04:54server also
04:55okay so this is T2 dot micro okay I am
04:59under free trial right so it will not be
05:01billable for me but only this would be
05:02billable right
05:05so here
05:07so what I did in the last session right
05:10I had created a small project because to
05:13show you guys how to run a hello world
05:15Java program right I had created a maven
05:18uh demo project or the folder inside
05:21that folder I had explained about what
05:23are the base Dar what is this resources
05:25what is source code so for the source
05:27code always this is the structure of the
05:29where the maven follows so Maven always
05:31follows under the base they are it
05:33always sees that there should be an SS
05:34battery under Associated there should be
05:36main under that main there should be
05:38Java under that you can keep all your
05:39dot Java file so I think I remember I
05:43had did the same stuff
05:45so let me go here yes the servers have
05:47come up now so let me log into the
05:49server so click on this you need a
05:51public IP copy this public IP go over
05:53here just paste it and give colon 8080
05:56because your bill kills will be running
05:58under the port number 8080
06:00right
06:01okay so it is still the server is not at
06:04come up that's the reason you are pissed
06:06you need to wait for some time yeah it
06:07has come up so let me log in so I'll
06:09give red hat
06:11password is red hat so I will log into
06:14the server
06:15okay fine so here what happened I will
06:18even log into this server also so let me
06:20copy this and then open this putting
06:22session
06:24I I had already created a profile here
06:26guys so I'll just Ubuntu what the rate
06:28load it and then you just give IP
06:30address
06:31so I'll be able to directly log into
06:33this server
06:36right all setting has been already been
06:38done I have created a profile so
06:41if you do an LS so nothing is there let
06:44me check if I'm at created that
06:48nothing user here okay I think in the
06:50dummies fine that's fine so let me log
06:53into the dummy server go to the dummy
06:55copy the public IP
06:57go to the put decision launch the putty
07:01to Ubuntu at the right load give like
07:03public IP and say okay
07:07so now guys here
07:09yeah so here this is my dummy server so
07:12the dummy server I remember I had
07:14created this map and demo folder and you
07:16know that
07:18under the source SRC
07:20Java main under here I had created a
07:23main.java file so this is a basically
07:26simple hello world program
07:28and if you come out
07:30if you come out from here
07:32and you know that you are having a
07:34palm.html file and this is a simple XML
07:36file which we have created right so I
07:39had created this so This directly I took
07:41from the internet the palm.xml and these
07:43things I just added it because right the
07:45new uh like Maven right it expects this
07:49compiler to be available and that should
07:51be greater than 11. so hence what
07:52happened right I had even added this
07:55step also if you go through my last
07:56video right you'll get to know about
07:58this okay guys now this is what the
08:00dependency I mean this is what
08:03a minimal form.xml is there is there
08:06actually you can have many more things
08:08in the Palm data mix XML but the very
08:10basic form.xml will have always have
08:13this content raise
08:14now as I said earlier maven
08:17the maven
08:19the maven build tool
08:24it is used to download
08:28all the dependency
08:31required for the project
08:35like for example guys suppose I want to
08:37download some kind of a libraries right
08:40so uh the Google Community itself or the
08:43Google company itself what they've did
08:45right they have created a lot of
08:46libraries so they called as a a Goa
08:49Library like for example Google
08:56it means that Google itself has
08:59no design a lot of libraries and they
09:00call it a Goa Library so I need uh all
09:03Goa libraries through the maven actually
09:06so if you click on this you could see
09:07that there is a site in the maven dot uh
09:09mavender repository.com so this
09:12mavinreposite.com guys this is the main
09:14memory repository site where you will
09:17get all kind of a dependency Library
09:21so this maven.reposite right Marvin
09:24repository is this site
09:26this site right
09:28it is a main or we call it as a central
09:33repository so these are site very
09:35important side where each and every Java
09:37developer any Java developer might be
09:39he'll be referring to this site and if
09:41whatever libraries you need right he
09:43will try to download from this site
09:44itself guys and uh the very popular uh
09:47you know a very popular libraries is a
09:50geo a Goa Library which is developed by
09:52the Google Community or the Google
09:53Organization
09:54now if you come over here you could say
09:56these are all the very popular right if
09:58I go at the top I'll go with the Google
10:00core like Library response in Java I'll
10:03click on this guys now you could see
10:05that there are so many libraries are
10:06there so I will go with the
10:0831.1.jre click on this now you could see
10:11that okay this is some kind of a goal
10:13library net what I will do guys I'll
10:15just copy this
10:16I'll just copy this entire thing now
10:18what I will do I'll go over here and
10:20then what happened right I need to just
10:22add
10:23one more stuff actually here
10:26so what is it you are going to add
10:28you'll be adding a dependency
10:31to open that form.xml guys
10:33again come over here and just say add
10:37what to add it
10:38cash
10:40dependencies deepened
10:44pregnancies
10:51that should yeah
11:06so this is a dependency section under
11:08with your form.xml
11:11so this is the dependency section guys
11:12so
11:15under this what you have to do right you
11:17need to copy this content See Now to
11:21copy this content copy this content
11:23and then paste it
11:26okay so here what happened right so this
11:29is what this is what the uh you know
11:32like the label you assigned under this
11:34dependency label under that you have
11:36just copy paste this whole dependency
11:38this is nothing but your Goa Library
11:40some kind of a library you needed
11:43actually for your project so just copy
11:44paste it right and then say save this
11:47file
11:48now you know that actually like in the
11:51last session for building the project I
11:53had used a maven command how I use the
11:55maven command because you already
11:56installed the maven how to install it
11:58you have to use the command sudo app to
12:00install wait maven.wise this is the
12:03package you installed it once you
12:05install this suda app installed Maven
12:07hyphen y right then you got a maven is
12:10installed so here if you check NBN
12:12hyphen F1 version or MBM hyphen version
12:14you could see that Maven is installed in
12:17your machine and the maven is 3.6
12:20version
12:22correct guys so now what you are doing
12:24here you are trying to do a mbn compile
12:27now whenever you're doing mbn compile
12:30what the compiled MN will do that it is
12:32going to check into this com.xml under
12:34the dependency section under this
12:36section
12:38okay it understands oh under this
12:40dependency section
12:42whatever whatever the user requires it I
12:46need to download all these libraries so
12:48we'll try to download it so here when I
12:50do an mbn compile
12:52to enter can you see guys it will try to
12:55download all libraries even from the why
12:58it is doing that same some problem or
13:01incredible processing for it
13:03okay
13:05why it is showing some error what is the
13:07Java version I need Java hyphen version
13:11okay guys so here what happened right
13:13here you are having a Java 8 version
13:15which installed which is older version
13:17so I need to install the Java 17 version
13:21okay so I think already the Java 17
13:24version is installed in my machine okay
13:27let me go to the net and just say Java
13:30alternative command
13:32so if you run a Java alternative command
13:34I will get this command so let me just
13:36copy this command
13:38I will tell you about all these things
13:39what I'm doing now just try to
13:41understand or just try to listen what
13:43I'm doing here so if I do it see here
13:45already Java 8 is the Java 17 is also
13:48there in my machine so now right now it
13:50my Java is actually pointing to the Java
13:528.
13:53right so now I need to point to Java 17
13:55so I'll give the option as 1 and say
13:58enter
13:59so now what happened guys the Java is
14:01now pointing to the 70 motion if I do a
14:03Java hyphen version now you could see
14:05that actually now you have got the open
14:07jdk 17 are they have got open 0k 1.8
14:10which is nothing but it was
14:12eight version was now we are pointing to
14:1517 version because why we are doing
14:17because that guys because that when you
14:20are using the section dependencies and
14:22all right like dependencies
14:24dependencies and all when you are doing
14:26when you're using the section or
14:28dependencies dependencies right you are
14:31using this section right it expects the
14:34Java to be available for higher version
14:37means some higher version is required
14:40always sorry
14:42dependencies higher version of java is
14:45required always higher version of java
14:49is required in our case in our dummy
14:52server I had installed the Java 8 as
14:55well as I had have installed the Java 17
14:58also
15:00but my JavaScript Java 8 version hence
15:03what happened right when we did a mbn
15:05compile it was failing here
15:07now suppose you are if you do an MBR
15:10hyphen version see NBN which Java
15:13version it is expecting see it is seeing
15:15the Java 17 version okay fine it will be
15:18that Maven also requires a higher
15:20version of the Java fine now when I do a
15:23mbn compile now
15:28okay it is throwing me some error unable
15:31to Cache it okay
15:34white is throwing error guys because
15:36you're having a Java 17 fine what is the
15:39maven version you are having guys
15:41so you're having a maven 3.6.3 okay so
15:45hence what happened right there is some
15:47mismatch is happening here it means that
15:49you are having a Java 17 please try to
15:53understand this is very important in my
15:55system plus you are having a maven 3.6
15:58version
15:593.6.3 version somehow with this
16:03combination it is not able to compile it
16:08Okay now what's the solution
16:11what we need to do now okay
16:13fine so Rajesh what you will do you just
16:16do a
16:18total at Cash
16:22search
16:24open jdk
16:29okay
16:31is also there which you had downloaded
16:34fine open jdk 16 is also there okay but
16:37whether the compilation will work for
16:39open jdk 17 oh I don't know it sorry 13
16:42it might work for 16 it might work for
16:4570. we don't know right so open dedicate
16:48713 is also there open dedicate is also
16:50there which is what the older version
16:51hence that's the reason it was not
16:53compiling for the older version okay
16:55fine so now Rajesh what about the maven
16:59I know that Maven is there for 3.6.3
17:03okay whether the maven you need any
17:05higher version okay let me check in on
17:08it
17:09foreign
17:13download okay
17:15so Apache Maven download is there okay
17:18fine I'm having a 3.8 version which is
17:21little bit higher than the 3.6 version
17:22correct
17:243.6 motion can I install this one Rajesh
17:27and try out okay see 3.3 version plus
17:31Java 1.7 or Java 17 above so it means
17:34that this three point the system
17:35requirement is that you need a maven 3.3
17:37plus Java IDK 17 Java jdk 17 Java jdk 17
17:41is already there but Maven 3.6 is there
17:44okay so but here is saying that this is
17:47sufficient for us to execute anything
17:48wine but and somehow I'm feeling right
17:50let me install this open jdk sorry Maven
17:533.8.7 but you are not getting a uh you
17:56know like RPM or there or the Debian
17:58with this version actually you need to
18:01download the source code
18:04okay fine you need to download the
18:06source code okay fine so let me download
18:08the source code here so what will do
18:10that we'll just do a right click
18:13do a copy link address go to the server
18:16guys here
18:17now what you will do here you will go
18:20here to the Optometry
18:23and you do a w get off
18:27copy that link but before that you add a
18:29pseudo because you you are working a
18:32sudos right Ubuntu is a pseudo user
18:33right so hence Ubuntu essential to do
18:36pseudo duplicate
18:38okay so you have downloaded that
18:41Apache iPhone okay let me extract it
18:43sudo
18:44R hyphen x v f extract the Apache
18:49so it has extracted okay fine good now
18:52when you do an LS you got this directory
18:54okay get inside the Apache Maven
18:56territory and say LS here you have some
18:58there's a binder tree go to the bin
19:00directory
19:00can you see here there is an mvn command
19:02is there oh it means that what is the
19:04version of mbn here
19:06iPhone version
19:08it is 3.8.7 okay whatever I needed the
19:133.8.7 I got it here so now whether the
19:17compilation will happen with the 8.3.7
19:20let's see now but you could see that
19:22whenever I want to compile here I need
19:25to give a complete path of this C where
19:28is this my one is there guys this is
19:29there under slash property Apache this
19:32and after that you have a mbn okay for
19:35timing I'll give the complete path so
19:36where you have to do this complete path
19:38okay because I am under I am under my
19:41project is then the maven demo so let me
19:43go to the maven demo inside under this
19:46do the complete path and do slash mvn
19:49space compile so this is a very awkward
19:53way because you are giving a complete
19:54path like this and a resulting so is
19:57there any way rajas I need not to give
19:58this complete path yes you need to
19:59create some kind of a unwanted variable
20:01and then you have to export it that we
20:03will do shortly after some time but
20:05right now I'm giving a complete path of
20:07this and then giving a compile now let
20:09us see whether the compilation will work
20:13okay still it's throwing another it
20:15means that there is some problem guys
20:17right there is some problem here so what
20:20happened right either it is not
20:21compatible with the 3.8.7 or either the
20:24Java version is not properly installed
20:26right so what we will do here okay let
20:29me do one thing let me install sudo app
20:33install
20:35open jdk
20:3716 hyphen jdk I'll just I'm just
20:41trialing
20:43jdk hyphen why I'm just installing the
20:45open jdkc so these are all the problems
20:48guys you will face it when you're
20:50working on the real time okay so hence
20:52what happened right
20:54yes open jdk 16 is getting installed
20:59okay
21:06so let me first see there what it is
21:07could not build the read one
21:10okay there are some main chord followers
21:13okay okay sorry guys I think that you
21:15did a mistake actually okay
21:18sorry sorry guys I think it is not
21:19because of this it is in the palm.xml
21:22which I did an X mistake actually I'm
21:24sorry so dependency dependency
21:31okay
21:33maybe guys this the b e p and d in
21:38foreign
21:47this spelling is correct this is also
21:50correct
21:51it is also correct yes I think we will
21:55just shift this to one place
21:58right so that yeah
22:01I think it should be inside that's the
22:03reason I think
22:05so let me cross it for one time yeah
22:08okay so let us see now okay
22:11let's see now share this file so now
22:14what I will do that I will go with the
22:15normal moment so I'll just say mbn
22:17compile
22:19so we did some circus now but let us see
22:21now whether it will work or not no it's
22:22not working that's unable to do it okay
22:25fine now what I will do that I will go
22:26with my own uh the other way opt uh
22:31Apache 11 bin mvn hyphen hyphen sorry
22:36compile
22:38whether this also works
22:41no guess it is not working so the
22:43project has one error it says that
22:45non-perishable formula must be followed
22:48by end attack and the start tag position
22:50star taxing is something like this Goa
22:53dependencies what is it okay hold a
22:55second
22:56did I downloaded come they copied it
22:59properly
23:06okay
23:07so let me check guys okay
23:21so the syntax okay that's the reason
23:26foreign
23:35[Music]
23:55foreign
24:27foreign
24:53property
25:00ah I guess I got the problem see you
25:02guys
25:03oh my God this is right this property is
25:06right
25:07oh my God okay this should come here
25:09actually
25:15ah this should come here this is what I
25:17was just thinking
25:18okay now I think it should work
25:22so let me check with this normal immune
25:25compile
25:28okay it's not working if this is not
25:30working then we'll go ahead guys
25:32I'll verify that why this is failing
25:35actually yeah okay still failing good
25:39strange
25:41okay let me see one more time
25:58foreign
26:08how come
26:10this is the error actually
26:19yeah
26:20last try one more try again
26:26under convince tag uh non-perishable
26:30some other way doing it Maven compiler
26:35second base
26:46uh
27:12yeah
27:14is this correct project is ending here
27:18this is perfect this is the missing
27:20thing yeah then yeah
27:27okay guys we have to do so much
27:28struggling everything
27:35now it is building yeah
27:37yeah sorry guys I did a mistake from my
27:39end uh what I did see what is a mistake
27:42I did I will tell you even though it
27:43took some time but that is fine it's
27:45good that we understood here I first
27:48what happened right this property tag
27:50was here at the down this
27:52cash property Bank was here which was
27:55very wrong because this property stack
27:57right it should be between this compiler
27:59tag only once you are chosen the maven
28:02compiler this and this should be ended
28:04here so what I did this property I was
28:06at here it was there actually and next
28:08what I did right I had removed this one
28:10and only this was there so I need to
28:12start with the tag and with the tag
28:14though the tags were missing here so
28:16hence what happened right this was
28:17failing guys so very sorry it took some
28:20time but it is good that we learned what
28:22exactly the error is going on right so
28:24here what I did here what exactly
28:26ambient couple is doing if you check it
28:28see M1 compile is also trying to
28:31download all kind of a dependencies
28:33whatever it requires for the Goa the Goa
28:36Google uh like right it is trying to see
28:38download everything see Goa libraries
28:40were all downloaded see all were
28:43downloaded
28:44correct now there is one more libraries
28:47there suppose like the Java application
28:49uh you know it want to connect or if you
28:52want to do some kind of a communication
28:53with the database so there is one
28:56Library you know there's a hybrid
28:57Library so if you go go to the Google
28:59and just say hibernate maven
29:04so see hibernate core relocation Library
29:07dependency Library so this is what we
29:09needed actually
29:11this is what we needed actually okay if
29:13you go to any one of this like if I go
29:14to this version 6.2 version see you
29:18could see that this is what you got it
29:19so this is for your core hibernate so
29:22I'll do one thing I'll copy this again
29:24here copier come back here
29:27open the palm.xml
29:30so here where you have to do that guys
29:32you have to down you have to keep it
29:34here only you have to cop it here only
29:36okay I'll try to copy the whole stuff
29:39here see your copy that dependency even
29:41the hibernate Library also you need it
29:42actually so then save this file
29:45again do a
29:48mbn compile
29:51each mvn compile so guys I am using the
29:53higher version of the mp uh Maven so
29:56that's the reason what happened right I
29:57am giving the complete path later I will
29:59show you that how to make it a shot you
30:01need not to use always this complete
30:02path some companies some developers they
30:04do always do the complete path but this
30:06is not a good sign so always you should
30:08give a
30:10command or you have to give some kind of
30:11aliasis or a short name you have to give
30:13it here I've installed the maven 3.8.7
30:16under the slash opt directory so I'm
30:18giving the complete path but that is
30:19fine so when I do a execute right
30:23so I could see that now it is here you
30:25could see that even it is downloading
30:27even all the hibernate all hibernate
30:29related Maven uh you know like libraries
30:33also getting downloaded
30:35right guys so that's the reason what
30:37happened why Maven is popular because
30:38that all these are downloaded from the
30:42mvnrepository.com so this is a site
30:45where you will get all kind of a
30:47dependent Library you want to download
30:49any spring boot you can download where
30:51you want any python related Library you
30:53can download from Beyond so this mbn
30:55repository we call this as a centralized
30:57Repository
30:58and always right open in every
31:00organization what they do right the
31:01companies right they will try to connect
31:05will try to connect automatically
31:07through this email repository and he
31:09downloads
31:10all right now you could see carefully
31:12here if you are working on a maven build
31:14tool then you need to go to this Maven
31:16section try to copy this paste and put
31:18and place it or copy into the palm.xml
31:21suppose if you are working on a Gradle
31:23tool so you have to go to the Gradle
31:24right under the Gradle you have to just
31:26copy this and paste in the you know
31:29palm.xml over there in the Gradle tool
31:31actually similarly you could see the
31:32garage that kotlin is there the shot is
31:35there kotlin is basically when you are
31:36developing any kind of Android
31:37application right you will be using the
31:39kotlin library right so this is the
31:41libraries which you have to use so like
31:42that way for different different tools
31:44they have already provided the complete
31:47dependency structure they have provided
31:49so so what the developer will do that
31:51based on his requirement and he go to
31:52the particular build tool and he will
31:54copy and he'll paste in the XML file and
31:56he will try to make try to download all
31:59those libraries under for his project
32:01requirement right so now the thing what
32:04happened guys this is nothing but this
32:06is the external it means that this is
32:08outside the network it is outside in the
32:10internet itself right but you know that
32:12there are many companies are there who
32:13are working on very complex project or
32:15very you know like some security light
32:17projects they work right right many
32:19companies right or they work some kind
32:21of an open or not open close projects
32:23which they work on very closed uh you
32:26know like uh very uh security light
32:28projects suppose some companies are
32:30working on some projects which are uh
32:32difference in our project right you have
32:34a drdo company or else in if you go to
32:37us there is a Department of Defense
32:39America is there Duty right dot we say
32:41so many companies are there who are
32:42working for some project related to them
32:44right so when those Java developers in
32:46those companies you know when they are
32:47developing some secular project right
32:50they cannot connect to the outside world
32:53so this is a centralized repository case
32:55they cannot connect to the outside world
32:56so when this Java developer they when
32:58they are sitting here
33:00when the Java developers are sitting
33:02here and when they are working on some
33:04Java applications for some different
33:07related project right they cannot always
33:10try to connect to this to the central
33:13depository they cannot connect to the
33:15central reposit letter and try to
33:16download all the packages they cannot do
33:18that because it leads to a lot of
33:20security loopholes so hence what
33:22happened right what they do right
33:24usually company itself will set up the
33:26its own remote repository so this is
33:29what we call the central laser positive
33:34or Central repository right this is the
33:37repository which is then in over the
33:38Internet it's there over the internet
33:40where usually people quite open and what
33:42is the site mvn repository.com
33:45here's a site right so we try to
33:48download all this dependency but as I
33:51said right every time it doesn't happen
33:53right many times what happened the
33:55company will they set up their own
33:57remote Repository
33:59so which is there within that you know
34:01which is that company boundary it means
34:03this everything is there within the
34:05organization boundary
34:09right it is an organization boundary so
34:11now what happened whatever the
34:13dependency where the developer required
34:14everything will be kept here under the
34:17remote repository within organization
34:19will keep it now who are developers are
34:22developing any project right what
34:24they'll do they'll try to directly
34:25download all the dependencies from this
34:27remote Repository
34:29so because that their organization is
34:32never connected to the outside world
34:33why because that because when you are
34:36working on some secure related uh
34:38application right usually what happened
34:39right this we call there is a
34:41terminology something was a clean room
34:43so in the clean room what happened right
34:44usually the companies who are working
34:47for a critical projector they call it as
34:49a clean room where uh over their Network
34:51right in within our in within the
34:53company's internet right they'll make
34:55sure in such a way that they cannot
34:56connect to the outside Network actually
34:58they have to develop all kind of
35:00projects within sitting in within their
35:02own company boundary itself within their
35:03own organization so in that case
35:05whatever dependencies where the
35:06developers recorded that will be there
35:08within the company only so Central uh
35:10Central repository whatever the content
35:12it has right the same content they find
35:13in their own remote repository within
35:15organization
35:16so that the dependencies involved they
35:18can download from there only and they
35:20can start working on the project
35:21that's why it happens
35:24okay so we'll be discussing about this
35:26remote repository after some point of
35:27time because when I'm explaining about
35:29the uh jfrog repository or jfrog uh or
35:34or
35:35Nexus right I will be explaining about
35:37what is the remote repository what is
35:39the remote what is the local repository
35:40and we'll be discussing that over after
35:42some time not now maybe after four or
35:45five sessions we'll we'll be discussing
35:46about this aspect about this tools
35:49actually
35:50so now
35:54okay guys so that's all about this
35:57repositories I thought I will explain
35:59you about what exactly the Mammon or the
36:01central repository is all about right
36:03now
36:04so here what I did guys here I try to
36:06compile it actually by using this
36:08command I try to compile it
36:11correct I try to compile it right now
36:14you say that okay fine Rajesh you have
36:17installed your Maven here under slash
36:20opt under that you have created an
36:22Apache directory and uh sorry under that
36:25you have downloaded the tar file tar
36:27file and you have extracted it so by
36:29using the pseudo tar hyphen xvf command
36:32that you extracted under that you are
36:34having it actually
36:35under that you are having a binder a
36:37tree under the bin directory you are
36:39hanging ambient command and some
36:40configuration related files are there
36:42that's fine that's all are required for
36:44this moment that's the reason what
36:45happened that you have kept here
36:48correct guys so now you say that
36:51actually that uh Rajesh I don't want to
36:54always give this complete path like that
36:56is there any way I can set an
36:57environment variable
36:59or can I completely set the whole path
37:01as an inward variable right you can set
37:04it guys actually so how to set it we
37:06will see now
37:08hold a second I'm just getting one call
37:16okay okay yeah
37:18so
37:22uh how to do that actually see to do
37:24that there are various aspects to make
37:26it as uh you know like to make the
37:28complete path as making it as something
37:30like a you know like uh setting up the
37:33N1 variable and all so usually uh when
37:35if you are working as a Linux if you're
37:38working with Linux right you know that
37:40there are many methods out there to do
37:42all those settings for example under Etc
37:45there is a file known as a environment
37:47see under here you can set the whole
37:50stuff actually
37:52and set the whole stuff it means that if
37:53you want to set the whole path you can
37:55set the whole path or else guys what
37:57happened right you can go to the
37:59internet
38:01what you can search you know you can set
38:03it as a
38:05setting
38:06system environment yeah I think it's
38:09already there yes you know what variable
38:11in Ubuntu
38:13you can go to any article setting up the
38:16involved variables on Ubuntu
38:19so here there are various methods are
38:21there there are four to five options or
38:23the methods are there where you can set
38:25and one variable see there is something
38:27using export command you can do second
38:30is that you need to order you can even
38:31create under EDC environment file that's
38:33what I was saying earlier that you can
38:35set all the parameter here in this file
38:36or else adding a shell script under Etc
38:39profile dot d okay this is what I have
38:42needed oh I can set some kind of a
38:44script here in this
38:45profile.dc profile.d okay fine let's see
38:48what other things are there what is
38:50saying that he's saying that export a
38:52variable name is equal to give the value
38:54then then do an echo of this value you
38:57will get printed RS under the ETC
38:59environment you can set it the along
39:01with the path information see he's
39:03trying to set the the whole Java
39:10and he's setting the his home director
39:12also something like my home so some
39:14variables it has been set over here okay
39:16fine so and other is that using the ETC
39:19profile.d you can create some script
39:21actually and you can place all those
39:23things so let me do this method let me
39:26opt for the third method okay how to do
39:28that okay let me go to the server okay
39:31so what I will do guys I will try to go
39:34to the
39:38PD to Etc profile dot d okay fine
39:42and uh what I'll do I'll create on Java
39:45before that let me do a ls7ld
39:49etc sorry e naught it is opt what is
39:52that Apache so I need this complete path
39:54actually okay what's it been
39:56this is what I needed okay let me take
39:59this path so also let me keep it here
40:01somewhere in notepad so that I need this
40:03path actually right so what I will do so
40:06Etc profile dot is there so let me
40:07create one file sudo VI
40:12that's fine we can give anything so it
40:16easy
40:18Marvin dot reception
40:20here what I'll do I'll just say export
40:24M2 it means that maven
40:27maven
40:292 underscore home
40:32is equal to
40:33give this complete path
40:39give this complete path
40:42and then you say already they have a
40:45pattern available you need to add this
40:46path to that path N1 variable so I have
40:49to say path is equal to
40:51M2
40:53dollar M2 underscore home
40:59dollar p a t h
41:02path and then say export path that's all
41:06you have to do set guys so export M2
41:09underscore home slash option this queue
41:13the complete path open with the single
41:14code and give the complete path of where
41:16exactly your Maven is there it's a new
41:18version of Maven 3.8.7 right it is there
41:21here and then you are using a path is
41:23equal to Dollar of
41:25this is the same variable you have to
41:27use is equal to Dollar of parts so what
41:29are the existing dollar variable right
41:31that will be added now and you are doing
41:33an export file that's all so then save
41:35this file
41:37now you can do anyway you can either log
41:39out and log in one more time so that it
41:41will get reflected the changes will get
41:42reflected right RS what you can do that
41:45you can exude a common source source
41:47space maven.sh
41:50so it exit the source that moment.sh
41:52fine good now
41:58and see here this path has been added
42:00now
42:03now when I do a
42:06version
42:09can you see that guys there is a maven
42:12Apache 3.8 is there see
42:15Maven 3.8.7 that whatever you need it
42:18right here where is it guys
42:21see where is it see 3.8 points whatever
42:24you needed right see now we are able to
42:26get it correct now can I do a mbn hyphen
42:30F1 version anywhere sitting anywhere in
42:32the in the system see I can go anywhere
42:34if I run it oh I am getting a 3.8.7 and
42:37it is referring to the Java 17.
42:40now so with the help of this command so
42:43you're able to do it RF you can just log
42:45out and log in
42:46so always better that always usually
42:49what people will do that they will try
42:50to log out and log in again to This
42:52Server so what they'll do that they will
42:54try to do an exit from the server
42:57and again relog into the same source so
42:59copy the public IP
43:01so that will also be better open the
43:03quotation
43:04either you can run a source command and
43:06then you directly you know Source on it
43:08so that it will get reflected or as you
43:11can log out and log in some people even
43:12reboot the system also sometime but
43:14that's fine so if I execute MB and
43:17iPhone version see you're able to get
43:19this complete path so it means that this
43:21is the latest version which I needed now
43:23guys if I go to my Navan demo
43:27sorry if I go to the maven demo
43:29and then if I run a command mvn compile
43:34well it works
43:39does it work see now I need to give the
43:41complete path that's slash opt Apache
43:44slash bin I know to use the computer I'm
43:46just giving mbn because that if I exude
43:48MB and what happened right it is always
43:50searched in this path that command Okay
43:52under this path slash open Team Apache
43:5511 bin right under this already this mvn
43:57is that oh it will try to take from that
43:58path mvn
44:00and then it will try to run this so if
44:03you're running a mbn compile this
44:04compile here is nothing but these are
44:06the goals so we will be learning about
44:08what are Maven goals actually now okay
44:12so now when I do a mbn compile you could
44:14say it has just compiled the code but it
44:17has not built any package so how to do
44:19that you have to run mbn
44:22package so mbn package so this is one of
44:25the other Target or the goal where you
44:27need to run it what the mm package will
44:29do mvn package will compile will test as
44:32well as it will generate the package
44:34generate the package means it will
44:35create the VAR or jar or ER file so
44:38finally we need an application to be
44:40bundles
44:41hence we need to run our mbn package
44:44command if you run a MBL package now we
44:46could see that apart from the compile it
44:48will also do the test if there isn't a
44:50testing is there that also it do it will
44:52also do a it'll also create a
44:56packages or the water jar can you see
44:58that it is already saying under sarajome
45:00Ubuntu Maven demo see under that it has
45:02created a Target directory under that it
45:04is creating a jar file see now if you do
45:07an LS I think we saw this in the last
45:09session also CD it has created a Target
45:11directory if you do a Target seated
45:12Target and LS
45:14now you could see that guys there is a
45:16jar file it has created this is nothing
45:18but your jar file right so if you do a
45:21Java iPhone jar and specify this hello
45:24world dot dot so okay it is there is no
45:27main manifest file is there but you have
45:29to run the command or you have to run
45:31that application with the Java jar
45:32command itself but that's fine this is
45:34not running that's okay I understood
45:35white is not running later some other
45:37examples I'll show then I will Ex I will
45:39run that example that I'll run the jar
45:41file it will run it so here this is not
45:42working but this is how you have to run
45:44the your application
45:46correct guys so now what I'm trying to
45:48tell here I'm trying to tell here like
45:50when you are ruining an ambient compile
45:52it is just compiling
45:55the code actually right it is just
45:57compiling the code once it is compiling
46:00the code you want to build a package
46:02means you need to run a mbn Target
46:04command
46:05right so before the target what happened
46:08usually right in every project you know
46:10that you need to First compile the
46:11project
46:12you need to First compile the project
46:15once you compile the Java project then
46:17you need to run the unit test case
46:18actually
46:19after running the unit test case you
46:21need to run
46:23the building the package actually
46:25building the package it means that you
46:26need to get the VAR or jar or ER file
46:30jar war or here file so to achieve this
46:33actually what you are doing here you are
46:35trying to run an mvn compile command
46:39fine this is just compile the code
46:40that's all if you want to even run the
46:42unit test case if there is any unit test
46:43case which is developed by the developer
46:45and if it is there in the source code
46:47you have to run a mvn test actually
46:50but if you're running ambient test what
46:52is the internal dose it will does the
46:54compile as well as it will do the test
46:56actually it will run the test cases
47:00but now after that what happened right
47:02here
47:04if you want to build the jar or worry or
47:07here file right then what you will do
47:08guys you have to rule an mbn mvn package
47:10command but MBL package what will do
47:13that it internally will do the compile
47:14as well as it will do a test
47:17and as well as it will even does a
47:19package also
47:21so as a part of running so if you're
47:23doing mvn package it means that it is
47:24internal running this ambient compile
47:26mbn test as well as in event package so
47:29what happened right whenever you want to
47:31build a package guys you need not to
47:32give like this me and compile phase
47:35tester space package you need not to
47:37give this command like this if you're
47:39giving like this anyhow all these things
47:41this thing taken care by the package
47:43command also so that's the reason in the
47:44industry people never do that they're
47:46always there to run directly run the mvn
47:48package from because they know that
47:49internally it does a compelling Azure
47:51testing actually
47:52so as part of this exhibition guys once
47:56you are running the mbn package you know
47:58that it is going to generate one target
48:00directory under the target directory the
48:03jar or war or ER file will be there
48:05right Char or VAR or EFI will be created
48:08under this target here you could see
48:10that
48:11already a Target directory is there so
48:13that is generated
48:14right now if you are doing a mbn clean
48:17so ambient clean what will do that it
48:19will try to remove this target directory
48:21it will remove all those compiled files
48:24or whatever you need it right that will
48:25remove see can you see that deleting the
48:27slash of Ubuntu Maven demo see if you
48:29don't an LS so it is deleting so what it
48:32is doing mbn
48:34clean
48:35this will
48:37clean up the
48:39Target directory
48:43so this mbn compiled mvn test mvn
48:47package mvn Clean This Clean package
48:50test compile this we call it as a maven
48:54goals
48:57Maven calls or we call it as a build
48:59phase actually
49:01we can either call the build phase or
49:03Maven goals
49:07so is it clear subtle here
49:19yes sir okay
49:22so we understood how to download the
49:25download the dependencies by going to
49:27the maven repository we also check that
49:29apart from the existing Maven that 3.6
49:32is there I want to go with some higher
49:33version of the maven right you can go to
49:35the maven site and you can try to
49:37download so this whatever we did now
49:40here guys here downloading it this we
49:42are doing it manually it means that you
49:45are not in your your uh you know you're
49:48downloading the archive or the Turbo
49:50from the site you're extracting it and
49:53then later you are setting up the in one
49:54variable so most of the time in the
49:56industry people will be going with this
49:58method only
49:59now why they are going with this mother
50:01why not with the 3.6 version why not but
50:033.8 right see usually whatever in the
50:06industry right what happened to the
50:07developer
50:08the developer what happened right he
50:09will be having a development N1 or Dave
50:11environment will say
50:13and what you'll be doing he will be
50:14developing the applications and he'll be
50:17using the Java 13 in his projects right
50:19and he will be using something like a
50:22maven
50:243.2 version I'm just taking some some
50:27version actually so he will be
50:29developing the whole application and he
50:31will be designing and he will be he'll
50:34be using the maven 13 I'm sorry Java 13
50:36and 11 3.2 version only
50:39now once he has developed it once he has
50:41compiled it he got the success result by
50:43this combination then what happened
50:45right that developers what happened but
50:46he will tell to the dev option of that
50:48under your environment under your
50:51environment means under the test
50:53environment
50:54under the test environment
50:56please install the sale setup have Java
51:0013 and I have the maven 3.2 League
51:04he will tell you also
51:07right so you need to agree with what the
51:09developer is saying guys
51:11now you say that Rajesh Maven 3.2 there
51:14is no package if I try to do a pseudo
51:17apps app search
51:19app search maven
51:22or apt cache search maven
51:27Equinox something like this you are not
51:29getting 3.2
51:31it is not showing oh maybe that 3.2 you
51:34are not getting as a different package
51:35so nobody has developed any package of
51:38the maven with the 3.2 version oh then
51:40what to do then if I don't have a
51:42package usually what happened I can try
51:43to install the maven with the help of a
51:45you know like uh sudo app to install
51:48Maven or 3.2 if I want to have 3.2 I
51:50want to I can install directly but the
51:53package itself is not there the Ubuntu
51:55distribution has not given that package
51:56only now what you will do uh you know
51:58that okay rajes now I need to manually
52:00install it oh how to install it I need
52:02to install through the source code it
52:03means that I need to install through the
52:05code actually through the code means
52:07because through the code which you need
52:08to download the tar which is a file so
52:12how you'll do you will go to the
52:13official site you will go with the
52:16official site
52:19right like for example you go to the
52:21Apache Maven site there you will try to
52:23search for this Maven 3.2
52:26it's a turbo you'll try to download so
52:28under your system you try to download
52:30the turbo under the slash open anywhere
52:32you can download you want to understand
52:33same password you can download so
52:35usually people who try to download the
52:36slash under the opt extract that Maven
52:39package and then under that after
52:41starting you'll get one directory like
52:43this under that you have some kind of
52:45Bin directory under that you you'll find
52:46that Indian command so this MBM whatever
52:49you are having under this uh Slash
52:51patchy moment right this is of the
52:53version 3.2 guys after doing that now
52:56you know available that how I have to
52:58set the in one variable so what you will
52:59do okay you know Rajiv said something
53:02here okay go to this path
53:05CD it is a profile.d go to this path
53:07okay
53:08go to this path like this create one
53:11file with this name mom and daughter
53:13says whatever right so and what we will
53:16do
53:17and you will try to
53:25now you will try to save whatever you're
53:27saying that with here you need to just
53:29replace Apache happen 3.2 whatever is
53:31that that you need to repress
53:32accordingly so you set it under this
53:35file you'll set this one and after that
53:36you will run a command source
53:39r1.sh or else you will try to log out
53:43and login again in the server
53:46organ log in and logout terminal one
53:49more time to make sure that it will get
53:51affected so more certain industries the
53:54devops channel will be doing this only
53:56so you never expect that you will get
53:58that particular version as a package and
54:00install with the APT command no you will
54:02not get it you have to go to the
54:04official site of them sometimes some
54:06developers some old developer might be
54:08there he might be using Java 8 or Java 9
54:10he might tell you though please use the
54:12maven 2.8 Max
54:16I don't know how to install it you
54:18cannot say that because you need to know
54:20how to download go to the official site
54:21of Maven and do it so that's the reason
54:24guys always whatever the devops
54:25developers he's using under his
54:27environment right the same environment
54:30you need to mimic in your testimony also
54:32because ultimately you are taking the
54:34whole code from the developer only
54:35wherever he is putting this code into
54:38the git reposit right from there you
54:40need to download and you need to do a
54:41lot of you know you need to do a lot of
54:43setup so you need to have the same kind
54:45of environment suppose in case the
54:47devops is an error he will be installing
54:50Maven 13 only
54:51right sorry Java 13 only but instead of
54:54installing Maven 3.2 he has installed
54:573.6
54:58and now he is compiling under his tester
55:00Norman maybe the code whatever the
55:02developers developer it might not
55:04compile it might throw in a the way we
55:06saw it earlier right it was continuously
55:07throwing because there are some mismatch
55:09with the Java version and with the maven
55:12and basically that that application was
55:15not supporting it actually
55:16because that application whatever it was
55:19not supporting with this version hence
55:20what happened right the compiler was
55:21always getting failed
55:23so always make sure that guys whenever
55:25the maven compile is getting failed
55:27there could be a chance that there could
55:29be a mismatch of the Java version with
55:31the developer has used on this
55:32environment and what you've installed in
55:34the Testament there could be a lot of
55:36difference would be there so that's the
55:38reason that make sure that always you
55:40try to obey what devops uh sorry what
55:42developer is saying okay he will say
55:44with this version Miss please go out
55:45with that doing with that only
55:48am I clear on this subtle here so this
55:51was very important which I thought I
55:52have to tell you because that this is a
55:54common issue where the devops user will
55:56always face whenever he's doing a build
55:58building of the project right he will
56:01face because there'd be some mismatch in
56:02the software versions
56:05correct guys so any doubts you have till
56:08here guys
56:12any doubts you have till here
56:15no no sir
56:17clear everything all clear
56:21yes sir good yeah okay fine so now what
56:25we will do now
56:27okay we'll do one thing guys we will try
56:30to download the Springer pet clinic
56:32project it's a open source project we
56:34will compile it will package it and
56:36we'll check it how it is working correct
56:38so now what I'll do here I'll go to the
56:40internet
56:42I'll go to the spring Pet Clinic
56:46GitHub like that I will do
56:50okay I'll go to this is the open source
56:52project click on this
56:54okay here after clicking on this you
56:56know that actually I want to get the
56:58GitHub repository means you have to
57:00click on this code and here you could
57:02see all you should always go to the
57:03https copy this link actually just copy
57:05this come over in the server here okay
57:09let me don't think let me come out from
57:10the maven before let me create a spring
57:14pet Clinic
57:16project actually
57:17create a directory with that name and
57:20then let's do a git clone of this
57:23project and say enter
57:27so now you can see that guys you have
57:29downloaded the whole project so go to
57:30this address bring Pet Clinic
57:32under that you could see that you have
57:33all the comma all the source codes are
57:35there so Rajesh can I download all sorry
57:38can I compile this whole project yes you
57:40can compare itself mbn compile mvn from
57:45m v n come sorry m
57:49p n compliant
57:52let's see whether you compiles or not
57:54see
57:55that's compiling see all the
57:57dependencies it is downloading whatever
57:59it requires right because it refers to
58:02the palm.xml under Palm dot XML there's
58:04a dependency section there under that
58:06whatever the dependencies are there
58:07everything it is downloading here so if
58:11you can go here see go here to the site
58:13and you could see that there is a under
58:14this uh spring pet clinic you could see
58:17there's a palm dot XML is there yeah let
58:19me open this pump.xml
58:22see can you see here guys oh parent is
58:24there something or it is referring to
58:26some parent Palm fine now you could see
58:28that there's a property okay this is a
58:29Java 17 it expects oh Java 70 is already
58:32there so this is a web dependency see it
58:34requires all this dependence you see
58:36after that there's a dependency what
58:38depends the periods it needs all spring
58:40bed framework you see spring uh
58:42framework dot boot spring framework dot
58:45so these are the spring Frameworks which
58:47it is downloading hence you could see
58:49that see it is still downloading and it
58:51has final test did a build success so
58:55what I did guys I did an ambient compile
58:57here now when I did an embed compile
58:59here and when I do an LS it could see
59:02that there's a Target director it has
59:03created okay let me go to the Target
59:05entry LS
59:07and you could see there's a class
59:09directors credit classes that it is
59:10created enter LS can you see here guys
59:13there are these are all the class files
59:15are there where it has generated the
59:17class files
59:18class volume is dot class file it has
59:20created actually because it's a big
59:22project under each and every section
59:24right it has created class file right
59:26now you say that Rajesh come out from
59:28here now Rajesh under the spring pit
59:32clinic right you have an SRC where the
59:34source Courts are there
59:36under that can you see there's a tested
59:38director is there okay oh Rajesh these
59:41are tested directory where all the unit
59:42test case are faced so all the unit test
59:44codes are written and it has placed
59:46under this test directory okay let me do
59:49a compile
59:50uh let me do a mvn test command
59:54and the ambient test it also does the
59:57testing of that means that it also
59:58execute the unit test also so when you
01:00:01do a enter
01:00:02and we do an ambient tester so as I said
01:00:05earlier when you're doing mbn test MBA
01:00:07test in turn will do a compile as well
01:00:09as it will do a test now you could see
01:00:11that it will do a compile also it will
01:00:12do a test also both it will be done by
01:00:14the ambient test
01:00:38see it is doing your testing also see it
01:00:41is doing your testing also
01:00:54so this would take some time but that's
01:00:56fine for us
01:01:12see the build adjustments the build
01:01:14means the test has passed actually all
01:01:16the tests you could see that test run 10
01:01:18tests are passed zero is failed even the
01:01:20unit testers also has passed everything
01:01:23now guys once the unit test has passed
01:01:26you need to get the unit test results
01:01:27actually so where the result should be
01:01:29there if you do an LS can you see
01:01:31there's a Target directory there okay
01:01:33let me go to the task directory under
01:01:35that can you see there's a Surefire
01:01:37reports are there okay go to the Shopify
01:01:39reports under the show for reports guys
01:01:41all the test results are placed here I'm
01:01:43going to do LS of an L you could see
01:01:45that these are all the test reports you
01:01:46could see that some file is having a DOT
01:01:48txt and some files is having a DOT XML
01:01:51this XML we cannot read it but yeah of
01:01:54course all this dot text file I can read
01:01:55it suppose I'm opening some text file I
01:01:57mean I'm just opening this one org dot
01:02:00stringframework.sample dot text
01:02:02something this one I'm opening I'll say
01:02:04VI open this and say enter can you see
01:02:07that it is showing you the test is okay
01:02:08out of the execution of this uh unit
01:02:11test right one has actually one has
01:02:13passed 0 squared error okay you're
01:02:15getting some result
01:02:17okay so this is how guys it is you are
01:02:20you need to get so always guys whenever
01:02:22whenever you're running MBA tester in
01:02:24this case for example for the spring pet
01:02:26clinic where the test results are placed
01:02:28on the target Sure Fire hyphen report so
01:02:31this is the path guys you should always
01:02:33remember okay Rajesh under this the
01:02:36Surefire result or the unit test results
01:02:37are placed so what we did here
01:02:41we
01:02:43build
01:02:46the
01:02:48spring pet clinic project
01:02:51Eric open source
01:02:54Java spring
01:03:00in framework project
01:03:05so for that what we did guys we tried to
01:03:07do the clone of the project I did a git
01:03:10clone and then I try to give this
01:03:21can they say no need
01:03:23see
01:03:25I try to do this complete
01:03:28so I cloned this project right I cloned
01:03:31this after that so before that you
01:03:33create One Directory actually mkdr
01:03:34something spring pet clinic demo
01:03:37directory created under after that you
01:03:39did a CD to SPD demo anything you can
01:03:41give any name under that you are just
01:03:43doing a clone actually right after
01:03:45getting the Clone what you did guys you
01:03:47did an mbn compile and you and later you
01:03:50did an MBL test actually so once the
01:03:52invent test what will do that it will
01:03:54run the
01:03:56unit tests actually and
01:04:00and the result
01:04:01will be
01:04:03placed
01:04:04under the
01:04:07Sure Fire
01:04:10reports
01:04:12right where is the path for that in our
01:04:14case or in my case in my system surefi
01:04:17Reports say under this path the reports
01:04:19are there this is one interview question
01:04:20they'll ask you where all the unit tests
01:04:24results are based you have to always say
01:04:25sorry it is sure file reports simpler to
01:04:27use the name sure5 hyphen report that's
01:04:29all
01:04:29right
01:04:31right now you could say that Rajesh
01:04:33where is the jar file or war or year
01:04:34file that is not there okay oh for that
01:04:37man you have to do an ambient package
01:04:40yes so let me run the event package so
01:04:43come out from here
01:04:45go back to your base Dr where your palm
01:04:47dot see whenever you're running mvn
01:04:49compile ambient test always guys you
01:04:51should be there under your best ER the
01:04:54best Dr is this one
01:04:55so because wherever the palm.xml file is
01:04:58they are under the same under the same
01:05:00path you should be there to run the
01:05:01command you cannot go somewhere else
01:05:03that you can I cannot go to the Target
01:05:04directory and I cannot do ambient
01:05:05component all it will not work because
01:05:07MN will always try to check for the
01:05:09palm.xml file
01:05:11this is kind of a parent problem you say
01:05:13or it is a main pump or under the home
01:05:15base Dr So based air what in the last
01:05:19session in the last session we had
01:05:20discussed what is the best letter this
01:05:22is the base directory so wherever you're
01:05:24creating a directory where are you
01:05:26placing all your code right that becomes
01:05:28your build area and in that base there
01:05:30itself you will find a palm.xml file
01:05:32right so this source code and all will
01:05:34be there under your base Dr so here what
01:05:37happens the base Dr in my case it is but
01:05:40the spring competitive clinic this is my
01:05:42best ER actually so here these are my
01:05:44best they are under which the form
01:05:46production here I need to run the
01:05:48command mvn package
01:05:55okay okay good
01:06:05so what ambient package will do now
01:06:07you know that mbn package will try to do
01:06:11a
01:06:12compile
01:06:17Let's test
01:06:19as well as it will try to even do a
01:06:22package also package means it will
01:06:23generate
01:06:26whatever you need right that
01:06:28format whatever is that you will get it
01:06:30right where it will create under the
01:06:33target data see it is still running you
01:06:34know that under your base directory base
01:06:37they are
01:06:38under your base their path there is a
01:06:40target data you created under the target
01:06:41letter it will create the if it will
01:06:44create the jar or war or ER whatever is
01:06:46there right see now you could see that
01:06:47here it has compiled and you could see
01:06:49that here under the slash home Ubuntu
01:06:51Spectrum Clinic dot Target it has
01:06:53created a stringpit clinic dot jar file
01:06:56can you see it under the target so under
01:06:58the target directory now you could see
01:07:00that this is a spring training so this
01:07:02Dar file is estimated here so under this
01:07:04it has created this R5
01:07:07right under the bhdr it has created a
01:07:10jar file
01:07:12I can even run the jar files as I said
01:07:14like earlier like you can even run the
01:07:15Java command Java hyphen jar and run the
01:07:18spring pet clinic jar see it start
01:07:20running this application will start
01:07:22executing or running see it starts
01:07:24running
01:07:28starts running see
01:07:29so it is
01:07:31it is starting a lot of services and
01:07:33finally it will start the application
01:07:35spring spring pet training application
01:07:36will start
01:07:39okay started the printing see started
01:07:42the spring pet clinic in 16.1 seconds
01:07:44the process is running see now because
01:07:46you are running this in your dummy
01:07:48server here
01:07:49I am running here under my dummy server
01:07:52here so right so I'll copy this
01:07:55I'll copy the public copy of the dummy
01:07:56go here
01:08:02oh sorry you have to give a port number
01:08:048080 right
01:08:05because under the 880 report is under
01:08:07that 8080 that's been put Clinic is
01:08:09working spring but then you see
01:08:12we are able to see this project yeah
01:08:14you're able to see this application up
01:08:15and running now correct guys
01:08:18correct this is a spring pit Clinic
01:08:19project actually
01:08:21so you're running that application here
01:08:22actually
01:08:23under your dummy server
01:08:26correct guys
01:08:28so I'll do a Ctrl C so I'll be killing
01:08:30that confusion
01:08:32so this will also go off okay right so
01:08:34now so that's how
01:08:36that question comes one major question
01:08:39comes or very important question comes
01:08:41Rajesh when you're doing mbn compile you
01:08:43said that from the palm.xml the
01:08:45dependencies are the all the
01:08:46dependencies will be downloaded okay
01:08:48fine where where the from the way the
01:08:50dependency is going to download is going
01:08:51to download from this mbn repository we
01:08:53know that let's see now it's one okay
01:08:55so where it is Android it will go to the
01:08:57mbn deposit rate so this is the main
01:08:59repository or we call the centralized
01:09:01control from there already tried to
01:09:02download all the dependencies fine but
01:09:04after downloading where to keep it or
01:09:07where just keep it actually so if you
01:09:09come here guys under the home directory
01:09:11under the under that's home under the
01:09:14user's home directory here it is Ubuntu
01:09:17right under your user home directory
01:09:19there's a directory you'll create
01:09:20automatically by an M2 see CD to the M2
01:09:24under that you will have a repository
01:09:26under that see all the repositories are
01:09:29placed see these are all the reporters
01:09:30it is which has been downloaded and kept
01:09:32over here
01:09:33okay so where is the path guys so what's
01:09:37the question comes now where from where
01:09:39where all the
01:09:42downloaded
01:09:44Maven repository is kept
01:09:49so guys always
01:09:51it is always kept
01:09:54under
01:09:56home directory
01:09:57home directory under that there is an M2
01:10:01Delta dot M2 data will be created hidden
01:10:03letter under that it will create a
01:10:05repository this is the path case where
01:10:07all the all the repository all the
01:10:09download repositors like for example
01:10:10earlier we had downloaded the you know
01:10:13like uh hibernate uh you know like uh
01:10:15Goa Library we downloaded as well as we
01:10:19downloaded many other libraries right so
01:10:21everything will be downloaded and kept
01:10:22under this and so
01:10:23so this is what always so it means that
01:10:26for every user accounts so here in my
01:10:28case it is Ubuntu tomorrow gaurav is
01:10:30building and if he's he gaurav is
01:10:32sitting under his own battery under
01:10:33slash home gaurav under that dot M2
01:10:36title because under the repository under
01:10:38that all the maven should be downloaded
01:10:40uh Maven dependent should be downloaded
01:10:42simply if
01:10:43naresh is sitting under slash of naresh
01:10:46dot M2 so every individual user guys he
01:10:48will have its own Repository
01:10:51it will be kept actually and if you
01:10:53check the size of this repository I'm
01:10:55not sure how much it says it should be
01:10:57see 164 MB we are downloaded that's what
01:10:59that much of libraries we have
01:11:00downloaded from the from the central
01:11:02repository or MN Repository
01:11:05am I clear subtle here
01:11:07so this is also one of the intro
01:11:09questions where they will all the will
01:11:11be kept it will be kept under your
01:11:13home directories under that there will
01:11:16be dot M2 data will be created under
01:11:17that repository under that repository
01:11:19all your deposit repositories will be
01:11:21downloaded will be kept here because
01:11:23your project will always be depending
01:11:25upon this dot into Data only
01:11:27so whatever the libraries it needs it
01:11:29will try to take the Liberation it will
01:11:30refer you'll do a reference of that
01:11:32library from the dot and product
01:11:37foreign
01:11:43now what we will do okay fine Rajesh you
01:11:46are doing everything here by sitting in
01:11:49that server by sitting in this dummy
01:11:50server I have to do the same thing in my
01:11:52Jenkins server whatever you're doing a
01:11:54build activity I need to do the same
01:11:56build in my Jenkins server
01:11:59on second race
01:12:28okay sorry guys so now what you are
01:12:31saying that Rajesh I want to build the
01:12:32same project right Rajesh whatever
01:12:34you're doing in here in the command line
01:12:36under your dummy server this is a dummy
01:12:38server I need to do the same thing now
01:12:40in my I need to build the same project
01:12:42here and by Jenkins server okay fine
01:12:44okay I think I already logged in the
01:12:46Jenkins actually right this is Jenkins
01:12:47right so let me check first what is Java
01:12:50version because I need a Java 17 right
01:12:51okay Java 17 is that what about the
01:12:54maven
01:12:55version
01:12:57okay mbn is not there okay let me go to
01:13:00the slash open Battery whether it's
01:13:01there oh here it is not there guys so I
01:13:03need to do the same stuff actually so
01:13:05let me do the same stuff wget and go to
01:13:08the maven this is again we are repeating
01:13:10so come over here try to do a click on
01:13:12it copy link address do a
01:13:16sudo duplicate and then use a complete
01:13:19path this is the path of your the whole
01:13:22Maven no tarball actually so this is a
01:13:24binary right it's a binary so download
01:13:27it so I download it then you have to do
01:13:30a sudo
01:13:32what do you say tar hyphen xvf
01:13:35specify this
01:13:38so your extracted it guys right after
01:13:41extracting you know variable that under
01:13:43the Apache uh directory Apache F and my
01:13:45one you will get a bin directory under
01:13:48the bin directory you have mbn command
01:13:49so this is the mbn 3.8.5 right if you do
01:13:53a DOT slash mvn hyphen FN version
01:13:57this is what I needed actually in my
01:13:59Jenkins server also fine it is there in
01:14:01under this path okay fine good now what
01:14:04I will do here I will need to set up uh
01:14:07I need to set up what happened I need to
01:14:09set a I need to create a this one right
01:14:11so I have to say CD it is C profile dot
01:14:14b I need to set as a path and variable
01:14:16as a into the path renewable so I need
01:14:19to set a profile for that for that I'll
01:14:20be using it is a profile.d under that
01:14:22what I will do is I will create one
01:14:24maven.sh any script you can in the
01:14:27description we can create so I will do
01:14:28the thing I'll go to my notepad and I'll
01:14:31just blindly copy this whole stuff
01:14:32actually
01:14:33that's the same thing guys right and
01:14:36then insert it yeah
01:14:38now then
01:14:40paste it
01:14:41right so you can even do a source of E
01:14:44to C profile dot b and say maven.sh
01:14:50so you can do that now if you execute
01:14:52Maven hyphen NFL version you should be
01:14:55able to get 3.8.7 good now if you're
01:14:58doing a code dollar path
01:14:59okay you should be able to get okay
01:15:01Rajesh I think everything is set down
01:15:03now Rajesh what I have to do that I need
01:15:05to run a say spring same spec uh spring
01:15:09pet clinic right where you need to do I
01:15:11need to do it in my Jenkins as a job so
01:15:15I've already logged in into the Jenkins
01:15:17server so you go here I think I've
01:15:19already logged in I think the connection
01:15:20has lost yes connection is lost let me
01:15:23log in so Rajesh
01:15:26through the password and login so this
01:15:28is my Genki server so let me do create a
01:15:30new project now so new item just say
01:15:34spring training demo hyphen demo or
01:15:37spring but Clinic
01:15:40thing Pet Clinic
01:15:42I've already created a lot May create
01:15:44with the demo three something demo three
01:15:46I'll give this name I'll go to the
01:15:49freestyle project okay I will not go
01:15:51with the pipeline and all later we'll go
01:15:53with the pipe sending so click on this
01:15:54and say okay
01:15:58so you could see that guys you have
01:16:00created a new job now so description
01:16:02this project is to build
01:16:05this free pet clinic using Java 17
01:16:09and Marvin
01:16:133.8.7 okay good
01:16:16this is what you are giving the
01:16:18description fine and here if you come
01:16:20down you need to select the git okay and
01:16:22you have to give the git URL what does
01:16:24it get URL
01:16:25come over here
01:16:27swing by Clinic
01:16:28because guys this this spring pet clinic
01:16:31it is actually it's a public repository
01:16:34anybody can clone that project actually
01:16:36right so you need not to give any
01:16:38username and password you can just clone
01:16:40it so you have to do a go here copy this
01:16:42come over here
01:16:44wherever you are doing so give that
01:16:48everything here you need to give any
01:16:49credentials come down here so what is
01:16:52under which branch this project is there
01:16:54so I think it is in a master it is in a
01:16:56main branch actually not master one so
01:16:58main is a brand so I need to give as a
01:16:59main here
01:17:00instead of Master I need to do mean
01:17:03okay fine so here you have given the
01:17:06repository the report the git repository
01:17:08details here you will find now if you
01:17:10come down here now you could see that
01:17:11there is under the build
01:17:14step right so guys in upcoming sessions
01:17:18we'll be learning about all these things
01:17:19what is a build environment what are
01:17:20these options what is a build trigger
01:17:22what is this this General under General
01:17:24you could see that there are many other
01:17:26things are there right exert this
01:17:27project concurrently throttle build this
01:17:29project current so this thing Center we
01:17:31will see it later don't worry as of now
01:17:33I'm not worried about all other sections
01:17:35right I'm just trying to build a simple
01:17:37spring pickling project here now if you
01:17:39come down here
01:17:41directly go to the build steps here go
01:17:43here see invoke the shell or execute the
01:17:46shell okay here what happened guys I
01:17:49will do a mvn package
01:17:52that's all and I will now you should
01:17:56give us mbn not mbn package there is a
01:17:59command right you need to give right and
01:18:01you have to say apply and save it
01:18:05so guys now you have build you have
01:18:07created this project spin pet clinic now
01:18:09you need to build the project actually
01:18:10so to build a project you need to click
01:18:12on build now let's see whether it will
01:18:14build it or not
01:18:15okay guys it has failed it actually see
01:18:17this project is to build the spring
01:18:19Factory fine if you print why it is
01:18:21failed let's see
01:18:23so Git it is trying to clone the git and
01:18:26all ah see it is saying that MV are not
01:18:28found
01:18:29so basically it is not able to find that
01:18:32where is that everything command see
01:18:34even though you have a you know like you
01:18:36have a you have a
01:18:38uh you know like you are set the party
01:18:40in the Gen can see you set the path
01:18:43everything see if you're a good mbn
01:18:44iPhone version it is executing actually
01:18:47it is trying to shoot
01:18:50it is showing you the output of that
01:18:51command but when you're creating a
01:18:54Jenkins job and when you're running it
01:18:56is showing it's a command not found
01:18:57actually maybe here if I execute the EnV
01:19:01command
01:19:02if you give the EnV command can you see
01:19:04that Envy command will show the N1
01:19:06variable of your system if you're good
01:19:07again you command can you see that MBA
01:19:09M2 underscore home C it is showing me
01:19:11that N1 variable okay Rajesh can I run
01:19:14the same command set command here M set
01:19:16command or the ambient command go back
01:19:17to your job
01:19:18configure
01:19:21okay come over here I don't know do
01:19:23anything I don't want to run this one
01:19:24first let me run the set or E and we
01:19:26command let me run the even EnV command
01:19:28and check it whether I'm able to see
01:19:30that M2 variable M2
01:19:35let me first check bill now
01:19:41see it has executed fine I need to see
01:19:43the output
01:19:44can you somewhere see mbn M2 underscore
01:19:46home see m is a l m c nowhere guys oh it
01:19:52is not if it is not able to it is not
01:19:54able to you if it is not able to see
01:19:56this animal variable only how it will
01:19:58get the path information about the MN
01:20:00command oh it is not getting mad somehow
01:20:03it is not able to get it so what is the
01:20:05fix for this there are many methods are
01:20:07there being a Linux user right you a
01:20:10being in a Linux system itself you can
01:20:12set it you can do many other things
01:20:13right you can do many steps actually but
01:20:16what I will do now okay I will go I'll
01:20:18do one thing guys I will set up a uh you
01:20:21know like uh MBL configuration itself
01:20:23I'll set it up how to set it to the mbn
01:20:25Mammon configuration go to your
01:20:27dashboard
01:20:29okay here you could see there's a
01:20:31management very important click on this
01:20:34Marvin Jenkins
01:20:35now if you come to the maven Jenkins
01:20:37sorry not my own sorry manage and kill
01:20:39sorry manage and kins and you could see
01:20:41that there is something as a global tool
01:20:43configuration okay
01:20:45there's also Systems Construction system
01:20:47is there there's something like a
01:20:48managed node there's something like a
01:20:50managed plug-in config configure Global
01:20:52Security there are many
01:20:54uh you know like uh you know uh Taps are
01:20:57there which I'll be going through later
01:20:59after some point of time not now because
01:21:01these are all very important we have to
01:21:03go through some of the many important so
01:21:05out of all these things guys the very
01:21:07important is the system configuration
01:21:09under system confusion what are all the
01:21:11things which are there right all these
01:21:13are important so in an interview most of
01:21:15the person 80 percent of the time
01:21:17they'll be asking the whatever you will
01:21:19find under system configuration settings
01:21:20right that only they will ask you of
01:21:23course you want in security also this is
01:21:24also very important these are managers
01:21:26also is very important manage credential
01:21:28configure Global Security these three
01:21:30are very important but I always observe
01:21:33that in interviews mostly they'll be
01:21:35asking a certain compression after you
01:21:37are answering some of the questions they
01:21:38might ask you some relative secretary
01:21:41Global confirmation Global or configure
01:21:44Global security settings and under that
01:21:46what are the important things are there
01:21:47can you tell me like that they will ask
01:21:48have you configured any user and have
01:21:50you provided any kind of a permission
01:21:52how to do that so you'll be censor under
01:21:54security there's a managed user which
01:21:56does that there I will do there I'll go
01:21:57and I will try to do a lot of settings
01:21:59whatever you are asking like that will
01:22:00answer
01:22:01so there are many Tabs are there guys
01:22:03which we'll be going through now but now
01:22:06what is what is the problem which I am
01:22:08facing is that actually under my spring
01:22:10pet clinic demo 3 somehow that project
01:22:13NBN package is not working that mbn
01:22:16government is not taking even though I
01:22:17have set at everything in the system in
01:22:19the Linux wisdom but in the Jenkins
01:22:21orbit is failing now how to fix it yeah
01:22:23there are many ways are there but one of
01:22:25the ways that actually you go to the
01:22:27dashboard
01:22:28under the dashboard go to the manage
01:22:29Jenkins under that there is a global
01:22:31configuration tool setting either click
01:22:33on here guys
01:22:35and you could see that there's a maven
01:22:37configuration is there okay fine this is
01:22:39what okay fine there's a JDT
01:22:40configuration if you have a jdk you can
01:22:42point what is daily configuration git is
01:22:45there okay and also if you graduates
01:22:47their ant is there you could see there's
01:22:49a maven is also there okay let me go to
01:22:51the add Maven mbn Maven add Maven here
01:22:54you could see that it is asking whether
01:22:56you want to do an automatic install no
01:23:00is there I don't want this so just
01:23:02deselect this option so I don't want it
01:23:05now what you have to do that you have to
01:23:07just give a maven name and the path of
01:23:09that Maven okay let me give mvn
01:23:12underscore what is the version guys we
01:23:14are having mbn
01:23:163.8.7 right so I will say mbn underscore
01:23:203.8.7 okay fine where is the home
01:23:22directory of the maven oh I know that
01:23:24Rajesh is
01:23:25so this is the path I need to do this
01:23:28like this
01:23:33you have to come under the manage
01:23:35section Maven section under that you are
01:23:37giving this path and then you have to
01:23:39say apply and save it
01:23:42okay guys apply and save it
01:23:45so it has saved it now fine now again go
01:23:47back to the dashboard
01:23:49come over here in the spring pet clinic
01:23:51guys
01:23:52go to the configuration
01:23:56go back here
01:23:59now you remove this
01:24:03you remove this can we do a mbn package
01:24:07here
01:24:09let us check whether it will run or not
01:24:11we'll see it
01:24:15I think it will fail because it will try
01:24:17to refer or it will try to check the
01:24:18same thing let us see
01:24:20it has failed again
01:24:23same thing mvn command not fun okay fine
01:24:26let's wait okay
01:24:29what are the things Rajesh you can do go
01:24:30to the configure for rajas somewhere it
01:24:33is not getting this commandment
01:24:35somewhere it is not getting this command
01:24:37Rajesh can we copy place the same thing
01:24:39whatever do one thing copy by the same
01:24:42thing here before ambient Pakistan just
01:24:45copy paste the same thing
01:24:47okay let me run this now let us check
01:24:49whether it work or not
01:24:51okay now you don't build now
01:24:56fourth job is running so let us click
01:24:58ah now it is building oh okay Rajesh
01:25:01something it is building oh it means
01:25:03that you are giving a complete the same
01:25:05the whole command you the whole stuff
01:25:07you are copy pasted and then you are
01:25:09calling a maven package ah now it will
01:25:11go to run okay this is one way by giving
01:25:14the complete information out there is
01:25:15many other ways are there which I'll be
01:25:16showing you right but this is one of the
01:25:18way where you will be doing more server
01:25:20developers some of the developers or
01:25:21devops they'll be doing this way
01:25:34ah see the Builder successful
01:25:37so mvn package has successfully created
01:25:39so where it will create you know that if
01:25:42you go to the Jenkins this is my Jenkins
01:25:44server guys you need to switch to the
01:25:46Jenkins
01:25:48and here you could see that you go I
01:25:50have to go to the workspace under the
01:25:52workspace can you see here spring rapid
01:25:55Clinic demo three okay spring effect
01:25:59okay under that you could see that it
01:26:01has created a Target under that you
01:26:04could see that it has created the jar
01:26:05file or under that you have the Surefire
01:26:08report right under that here under that
01:26:10you have a classes also so all those
01:26:13things are getting created under your
01:26:14workspace
01:26:16cut so this is one way or else what is
01:26:21other way you can do it okay fine let me
01:26:23don't think Rajesh so Rajesh I'm having
01:26:26a springer pet clinic demo three
01:26:28this I'm having okay but I need to build
01:26:31one more time but you had me you had set
01:26:34some configuration here right under the
01:26:36man manage Jenkins and under the global
01:26:39tour configuration under the tradition
01:26:41you had set here some Maven here right I
01:26:43need to see how you are doing it here
01:26:45they say you already set here this one
01:26:47how to make use of This Global
01:26:49configuration setting then I don't want
01:26:51to give that command so now what I will
01:26:53do guys go back to the dashboard let us
01:26:55do one thing let me create one more
01:26:56project of spring pet clinic demo four
01:26:58okay okay so let me don't think go to
01:27:01the go to this one but I want the same
01:27:04content whatever that I don't want to
01:27:06repeat it so what you can do here go to
01:27:08the new item just say spring
01:27:13clean it
01:27:17mo4 right
01:27:19mo4 but what you happen right it's
01:27:22official project but I need to copy the
01:27:24same content of the spring pet clinic
01:27:26tree only so come over here click here
01:27:28in the freestyle come at the down can
01:27:30you see copy from okay what is the copy
01:27:33from I need to copy the spring pet
01:27:35clinic from the demo three the whole I
01:27:37need to create a new project or the new
01:27:39job which is called Sprint pit Clinic I
01:27:42need to copy the whole stuff from the
01:27:43demo three okay so I'm copying it now
01:27:45you will say okay
01:27:47now you see guys spring pet clinic demo
01:27:494 has been copied but you could see the
01:27:51same thing whatever you are having in
01:27:53your demo three right spring but the
01:27:55same thing has been copied over here
01:27:56okay okay here I don't one second guys
01:28:14so guys what you did here you try to
01:28:16copy the same stuff okay Rajesh now this
01:28:19is all I required these are the other
01:28:21things I required this is okay this is
01:28:23also okay I required this is required
01:28:25but you I but I don't want this one I
01:28:28don't want this step actually
01:28:29build step I don't want to do it but
01:28:32apart from this if you click on the
01:28:34build step if you go to the build step
01:28:35if you queue can you see that invoke top
01:28:38level Target
01:28:39oh already is there so Rajesh how you
01:28:42got this option invoke top level uh top
01:28:45level Maven Target how do you got this
01:28:48option you got this option because right
01:28:50while installing jimmykins you saw you
01:28:52remember that we had installed some
01:28:53selected plugins so during installation
01:28:55of the selected plugin even it has
01:28:57installed even the maven plugin also by
01:28:59default
01:29:00so that's the reason you have got this
01:29:02option if you are not installed no you
01:29:04would have not got of this option so let
01:29:06me go and let me click on this invoke
01:29:08top level Maven Target click on this so
01:29:11here Rajesh what you're doing uh I want
01:29:13this Maven 3.0 this is what I had set in
01:29:16my server oh this is what it is right
01:29:17that you already set it here in the in
01:29:19the under the managing kids right oh
01:29:22this is what I needed what is the goal
01:29:23you need I need to just have a package
01:29:25man so nvn package you are doing
01:29:29so this is what you call the invoke top
01:29:31level manage so
01:29:32apply and save it
01:29:35so these are spring pet clinic demo four
01:29:37so go to the configuration again
01:29:40so this is a description fine come here
01:29:43here you are given a repository that is
01:29:45fine and Main fine here you are just
01:29:48under your build step your invoke you
01:29:51are setting the invoke top load Market
01:29:52under that you have already said this is
01:29:54the default deform is what are the
01:29:56system as that I don't want it I want
01:29:58this one which I have set it right and
01:30:00you have to give the top level goal and
01:30:02you have to just say save and apply
01:30:04and now you do a build now
01:30:08see guys you'll try to build it see it's
01:30:11building see now you know to give the
01:30:13complete Command see whatever you have
01:30:15given in Spring pit Clinic three right
01:30:16demo right that you don't want to give
01:30:18everything see you're calling from the
01:30:20map invoke the maven you know like from
01:30:22the uh you know like from the target
01:30:24Maven itself right whatever you set
01:30:25right that so it means that now from
01:30:27where it is picking see if the Mammon is
01:30:29speaking from here slash opt Apache
01:30:31right under the bin directory under this
01:30:33this is a maven which is getting called
01:30:37got it this is a man getting called see
01:30:40now it has got a success
01:30:43clear guys so there are two methods we
01:30:46saw right under the spring pet clinic
01:30:48three
01:30:49I have given all the things here
01:30:53including even the unknown variable also
01:30:55I've set everything here before mbn
01:30:58package I gave this methods and the
01:31:00second method what I did here that first
01:31:02I went to the manage Jenkins there I
01:31:05went to the global tool configuration
01:31:06settings under that here you gave a
01:31:09complete here you get a complete stuff
01:31:11here here is setting the your Global
01:31:14configuration setting you're setting for
01:31:15them I mean that in under your gen kill
01:31:17server you already installed the maven
01:31:18but it is there under this path under
01:31:20this path it knows that automatically
01:31:22your junkies know that oh under this
01:31:24there's a bin data under that there's an
01:31:25ambient laser oh from there it will try
01:31:26to pick it automatically
01:31:29right it'll pick it automatically like
01:31:31this and then say save and apply and
01:31:33then you created a one more demo project
01:31:35that is Springfield Domo 4 where you
01:31:37have invoked the top level Maven Target
01:31:40see invoke the you have option your
01:31:43choose option invoke top level
01:31:44management Target and here you are given
01:31:46this option
01:31:48right and you run it it has excessive
01:31:50successfully
01:31:52this is a clear guys still here see it's
01:31:54able to check that it has excluded
01:31:56perfectly and you are able to see the
01:31:59success also
01:32:01till here are you clear guys because
01:32:04this is a basic thing which we have
01:32:05covered now from here all the whole uh
01:32:09your understanding of your Jenkins so
01:32:11from here it starts because right there
01:32:13are many other things are there where
01:32:15you will be coming across with the
01:32:16Jenkins and the concepts and everything
01:32:18if you are clear up to here right the
01:32:20further things you can easily understand
01:32:21very fastly otherwise if you are having
01:32:24some doubt share itself understanding
01:32:26other aspects what I'll be explaining in
01:32:27the upcoming class all right it will it
01:32:30might not be very clear to you might not
01:32:31properly understand or you might not
01:32:33properly appreciate it you'll feel very
01:32:35very uh like you would feel somewhat uh
01:32:37you know like you've been confused at
01:32:38what is going on right but if you are
01:32:40clear up to here I am damn sure that the
01:32:42upcoming classes right you would be very
01:32:45much comfortable
01:32:47okay guys so guys I am very much willing
01:32:50to continue the session but because it's
01:32:52already been one half hour I'll stop the
01:32:54session now okay what we will do that
01:32:57that we will sit again we will again
01:32:59connect at tonight at 10 o'clock
01:33:02right
01:33:04we will
01:33:06continue
01:33:08uh the day uh what is the day seven now
01:33:11day seven can kills right
01:33:14so have your dinner sit
01:33:17uh at 10 o'clock by till up to 11 30 one
01:33:21out of four I'll take the session
01:33:23wait if some of you are not able to
01:33:25connect no problem you see the recording
01:33:26tomorrow okay and again tomorrow morning
01:33:29again tomorrow morning Sunday we will
01:33:32connect at 11 am again morning
01:33:33and we'll be continuing our jungle's day
01:33:36eight session and tomorrow evening I
01:33:39will tell you let you know whether I'll
01:33:40be taking or not most probably I'll not
01:33:42be taking tomorrow's evening season or
01:33:43night vision okay but tomorrow morning
01:33:45we'll continue so this is how I plan
01:33:47guys so so please connect at 10 o'clock
01:33:49again
01:33:51okay at 10 am at 10 pm tonight
01:33:56is it fine guys
01:34:01sure any anything uh any difficulty in
01:34:06understanding
01:34:08crazy
01:34:11it's good
01:34:13okay good good so from now onwards as I
01:34:16said right things will build up now now
01:34:17you will be learning many other things
01:34:19now okay
01:34:21okay guys taller then we'll meet
01:34:22tomorrow or today again at night 10
01:34:24o'clock 10 pm night um
01:34:26bye bye
🎥 Related Videos![Hip Pain RELIEF! Stretches And Exercises For Lateral Hip Pain](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1OBmlRvLRxI%2Fhqdefault.jpg&w=3840&q=75)
![Jenkins-Day-1|| Introduction to Continuous Integration and Continuous Deployment](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fyv04M45sPZU%2Fhqdefault.jpg&w=3840&q=75)
![Real Premium Bond chances, Labour tax plans & more (money news) | Cash Chats #podcast ep405](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnRv6P4CFa60%2Fhqdefault.jpg&w=3840&q=75)
![How to Build the Life You Want: Timeless Wisdom for More Happiness & Purpose](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNGE8BgxEOd4%2Fhqdefault.jpg&w=3840&q=75)
![Discovery 臺灣部落寶藏 第1季 信仰祭儀](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLPYxfEAOMIw%2Fhqdefault.jpg&w=3840&q=75)
![Lessons Learned at Coursera – Expert Roundtable with Julia Stiglitz](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2nBKbt35zO0%2Fhqdefault.jpg&w=3840&q=75)
![Hip Pain RELIEF! Stretches And Exercises For Lateral Hip Pain](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1OBmlRvLRxI%2Fhqdefault.jpg&w=3840&q=75)
Hip Pain RELIEF! Stretches And Exercises For Lateral Hip Pain
![Jenkins-Day-1|| Introduction to Continuous Integration and Continuous Deployment](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fyv04M45sPZU%2Fhqdefault.jpg&w=3840&q=75)
Jenkins-Day-1|| Introduction to Continuous Integration and Continuous Deployment
![Real Premium Bond chances, Labour tax plans & more (money news) | Cash Chats #podcast ep405](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnRv6P4CFa60%2Fhqdefault.jpg&w=3840&q=75)
Real Premium Bond chances, Labour tax plans & more (money news) | Cash Chats #podcast ep405
![How to Build the Life You Want: Timeless Wisdom for More Happiness & Purpose](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNGE8BgxEOd4%2Fhqdefault.jpg&w=3840&q=75)
How to Build the Life You Want: Timeless Wisdom for More Happiness & Purpose
![Discovery 臺灣部落寶藏 第1季 信仰祭儀](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FLPYxfEAOMIw%2Fhqdefault.jpg&w=3840&q=75)
Discovery 臺灣部落寶藏 第1季 信仰祭儀
![Lessons Learned at Coursera – Expert Roundtable with Julia Stiglitz](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F2nBKbt35zO0%2Fhqdefault.jpg&w=3840&q=75)
Lessons Learned at Coursera – Expert Roundtable with Julia Stiglitz
🔥 Recently Summarized Examples![The Hitler-Stalin Pact | Reflections Episode 9](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFiCmS9niS2U%2Fhqdefault.jpg&w=3840&q=75)
![Uncovering Corruption From Health "Experts" | Scott Carney](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJP76ekb_DxI%2Fhqdefault.jpg&w=3840&q=75)
![The Forgotten Geometry: A New Path to Unification](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTTSeqsCgxj8%2Fhqdefault.jpg&w=3840&q=75)
![Joe Rogan Experience #2194 - Luis Elizondo](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9gLPtRwXgCM%2Fhqdefault.jpg&w=3840&q=75)
![From Tesla to DNA: The Science of Scalar Waves - Dr. Sandra Rose Michael - Think Tank E44](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzPxOsOsbNo8%2Fhqdefault.jpg&w=3840&q=75)
![Bitcoin Holders...Watch Out for Sept](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNedUS9J4Er0%2Fhqdefault.jpg&w=3840&q=75)
![The Hitler-Stalin Pact | Reflections Episode 9](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFiCmS9niS2U%2Fhqdefault.jpg&w=3840&q=75)
The Hitler-Stalin Pact | Reflections Episode 9
![Uncovering Corruption From Health "Experts" | Scott Carney](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FJP76ekb_DxI%2Fhqdefault.jpg&w=3840&q=75)
Uncovering Corruption From Health "Experts" | Scott Carney
![The Forgotten Geometry: A New Path to Unification](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FTTSeqsCgxj8%2Fhqdefault.jpg&w=3840&q=75)
The Forgotten Geometry: A New Path to Unification
![Joe Rogan Experience #2194 - Luis Elizondo](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9gLPtRwXgCM%2Fhqdefault.jpg&w=3840&q=75)
Joe Rogan Experience #2194 - Luis Elizondo
![From Tesla to DNA: The Science of Scalar Waves - Dr. Sandra Rose Michael - Think Tank E44](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzPxOsOsbNo8%2Fhqdefault.jpg&w=3840&q=75)
From Tesla to DNA: The Science of Scalar Waves - Dr. Sandra Rose Michael - Think Tank E44
![Bitcoin Holders...Watch Out for Sept](/_next/image?url=https%3A%2F%2Fi.ytimg.com%2Fvi%2FNedUS9J4Er0%2Fhqdefault.jpg&w=3840&q=75)