0% found this document useful (0 votes)
84 views4 pages

Apache Maven - Duration: 1 Day

JALA Technologies offers job guaranteed programs for software engineers with experience ranging from freshers to 12 years. The programs cover technologies like Java, .NET, automation testing, DevOps, middleware, and more. Participants can become software engineers within 100 days. The document then provides steps to install Maven and configure a Maven project in Eclipse with TestNG for testing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views4 pages

Apache Maven - Duration: 1 Day

JALA Technologies offers job guaranteed programs for software engineers with experience ranging from freshers to 12 years. The programs cover technologies like Java, .NET, automation testing, DevOps, middleware, and more. Participants can become software engineers within 100 days. The document then provides steps to install Maven and configure a Maven project in Eclipse with TestNG for testing.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

A Job Guaranteed Program for Software

Engineers

Visit JALATechnologies.com for more details

Apache Maven | Duration: 1 Day

Installing the Maven

1. Download the latest version of Maven and Install by unzipping the war file

2. Create an environment variable MAVEN_HOME

3. Add the path for Maven. Path is always set to bin

4. Check the maven is properly configured using the command mvn –version

Installing the M2Eclipse Plugin

1. Select Help | Install New Software from Eclipse Menu

2. Add a new repository named M2Eclipse for the URL


URL: http://download.eclipse.org/technology/m2e/releases

3. Select the plugins and Install. Apache maven is integrated to the IDE

4. Check if maven has been installed successfully

5. Click Help-> About Eclipse and then check the presence of M2Eclipse icon

6. Get the details of the Maven installation by clicking on the M2Eclipse icon

Creating the Maven Project

1. Create a new Project from File-> New->Other, then Select Maven -> Maven Project

2. Select the Create a simple project while creating the Maven project
Group Id: com.jala.maven

JALA Technologies offers Job Guaranteed Programs for Fresher’s to 12 years’ experience with salary range of 2-16 lakhs per
annum on JAVA / .Net / Automation Testing / Dev-Ops / Middleware Technologies / WebLogic / JBOSS / Python and for those who
want to be a software engineer in 100 Days. Know more Details at: http://jalatechnologies.com/
A Job Guaranteed Program for Software
Engineers

Visit JALATechnologies.com for more details

Artifact id: MavenTest

3. Check the project structure

4. By default, the JRE System library is pointing to J2SE1.5. Change it default JRE on your
system (latest JRE on your system)

5. Select pom.xml from Project explorer

6. Add dependencies for TestNG, maven, Selenium and log4J with in the project node
Maven dependencies :-
maven-compiler-plugin
maven-surefire-plugin

7. Know the path where the dependency jars are downloaded to from central repository of
maven(.m2 folder in users->username)

8. Create a TestNG class in src/test/java by right clicking on the folder with all the
annotations selected and name it FirstTest
Add print statements for every annotation to check the order of the annotations
execution
Ex: System.out.println("Before Suite");
System.out.println("After Suite");

9. Add a first test case with the annotation @Test and name it firstTestCase

10. Run the TestNG test case and observe the order of the annotations execution

11. Convert the Maven project to TestNG Project by right clicking on the project and then
click TestNG->Convert to TestNG
testng.xml file is generated in the project folder

12. Running test from testing.xml


Right click on testing.xml, Run As -> Run configurations
Type testing.xml for Suite, So it runs testing.xml file when the test suite is run
Then continue running the test suite from testing.xml by right clicking on xml file

JALA Technologies offers Job Guaranteed Programs for Fresher’s to 12 years’ experience with salary range of 2-16 lakhs per
annum on JAVA / .Net / Automation Testing / Dev-Ops / Middleware Technologies / WebLogic / JBOSS / Python and for those who
want to be a software engineer in 100 Days. Know more Details at: http://jalatechnologies.com/
A Job Guaranteed Program for Software
Engineers

Visit JALATechnologies.com for more details

Running the test as Maven Test

1. Add dependencies for


maven-compiler-plugin
maven-surefire-plugin

2. Run test as maven test


Right Click on the project and Run As->Maven test
(Run Maven clean, Maven Build and then Maven test if script fails)

Default Life Cycle


The default life cycle is the build life cycle which generates, compiles, packages etc. your
source code.

You cannot execute the default build life cycle directly, as is possible with the clean and site.
Instead you have to execute a specific build phase within the default build life cycle.

The most commonly used build phases in the default build life cycle are:

JALA Technologies offers Job Guaranteed Programs for Fresher’s to 12 years’ experience with salary range of 2-16 lakhs per
annum on JAVA / .Net / Automation Testing / Dev-Ops / Middleware Technologies / WebLogic / JBOSS / Python and for those who
want to be a software engineer in 100 Days. Know more Details at: http://jalatechnologies.com/
A Job Guaranteed Program for Software
Engineers

Visit JALATechnologies.com for more details

Build
Description
Phase
Validates that the project is correct and all necessary information is available. This
validate
also makes sure the dependencies are downloaded.
compile Compiles the source code of the project.
Runs the tests against the compiled source code using a suitable unit testing
test
framework. These tests should not require the code be packaged or deployed.
package Packs the compiled code in its distributable format, such as a JAR.
Install the package into the local repository, for use as a dependency in other
install
projects locally.
Copies the final package to the remote repository for sharing with other developers
deploy
and projects.

JALA Technologies offers Job Guaranteed Programs for Fresher’s to 12 years’ experience with salary range of 2-16 lakhs per
annum on JAVA / .Net / Automation Testing / Dev-Ops / Middleware Technologies / WebLogic / JBOSS / Python and for those who
want to be a software engineer in 100 Days. Know more Details at: http://jalatechnologies.com/

You might also like