Tuesday 24 January 2023

How to Install Maven on Linux (Ubuntu) ? or Linux Instance or Dev-desktop


 


Top 15 Maven Interview Q&A



MAVEN:


At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing:

  • Builds
  • Documentation
  • Reporting
  • Dependencies
  • SCMs
  • Releases
  • Distribution


**********************************************
How to integrate Maven pom.xml with Jenkins job?


***************************************************

Maven Setup with Linux


Maven can be set up on Linux in a few easy steps. Installing JDK is the first step because Maven requires it to function. We will learn how to install Maven in Ubuntu in this guide. The procedures are universal, therefore they will be successful on any other Linux machine.



Install JDK on Linux/Ubuntu


Typically, we install everything in Ubuntu using the apt package manager. However, it is missing the most recent JDK packages. Although OpenJDK versions 8 and 11 are the only ones that are currently available, Java 13 is currently in use. Therefore, we will set up the necessary environment variables and install JDK using binaries.


Step 1: Download the JDK Binaries


Go to the URL: https://jdk.java.net/13/ 

Copy the download link for Linux/x64 build. 

Then use the below command to download and extract it.


$ wget https://download.java.net/java/GA/jdk13.0.1/cec27d702aa74d5a8630c65ae61e4305/9/ GPL/openjdk-13.0.1_linux-x64_bin.tar.gz
$ tar -xvf openjdk-13.0.1_linux-x64_bin.tar.gz
$ mv jdk-13.0.1 /opt/


I have moved JDK to /opt, you can keep it anywhere in the file system.


Step 2: Setting JAVA_HOME and Path Environment Variables


Open .profile file from the home directory and add the following lines to it.


JAVA_HOME='/opt/jdk-13.0.1'
PATH="$JAVA_HOME/bin:$PATH"
export PATH


You can relaunch the terminal or execute source .profile command to apply the configuration changes.


TIPS: If you don’t find the .profile then create a new file with the name as .profile


Step 3: Verify Java Installation


You can run a java -version command to verify the JDK installation.


$ java -version
openjdk version "13.0.1" 2019-10-15
OpenJDK Runtime Environment (build 13.0.1+9)
OpenJDK 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
$


Installing Maven on Linux/Ubuntu


We will install Maven in a similar way that we have installed JDK in the Linux system.


Step 1: Download the Maven Binaries


Go to the URL: https://maven.apache.org/download.cgi

Copy the link for the “Binary tar.gz archive” file.

Then run the following commands to download and untar it.


$ wget https://mirrors.estointernet.in/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
$ tar -xvf apache-maven-3.6.3-bin.tar.gz
$ mv apache-maven-3.6.3 /opt/


Step 2: Setting M2_HOME and Path Variables


Add the following lines to the user profile file (.profile).


M2_HOME='/opt/apache-maven-3.6.3'
PATH="$M2_HOME/bin:$PATH"
export PATH


Relaunch the terminal or execute source .profile to apply the changes.


Step 3: Verify the Maven installation


Execute mvn -version command and it should produce the following output.


$ mvn -version

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/apache-maven-3.6.3
Java version: 13.0.1, vendor: Oracle Corporation, runtime: /opt/jdk-13.0.1
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.4.225-139.416.amzn2int.x86_64", arch: "amd64", family: "unix"


$

That’s all. Maven is successfully installed in your Linux system.


==> Maven dependencies with pom.xml for Automation Framework design? How to add selenium, testng,cucumber dependency in Maven?

Ans: Click Here For POM.xml


*******************************************************************

For any doubts or career guidance, reach out to me 


********************************************************************



Once maven installation is done, do practice some Linux commands with the link below
Basic Linux Commands for Automation QA


****************************************

TOP 15 BDD - CUCUMBER Interview Q&A


************************************************

✍️AUTHORLinkedIn Profile

************************************************

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp : https://lnkd.in/dnBWDM33

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

https://automationreinvented.blogspot.com/search/label/Kubernetes

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

Linux Interview question Set

https://automationreinvented.blogspot.com/search/label/Linux

Automation Testing/SDET Framework Design

https://automationreinvented.blogspot.com/search/label/FrameworkDesign

Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java

GIT Interview Question Set:

https://automationreinvented.blogspot.com/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

https://automationreinvented.blogspot.com/search/label/Python



No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...