Apache Maven is a Java-based project management tool. It can provide a multitasking framework for developers. It eases the complete build lifecycle. Maven is pre-defined and declared in XML format called as POM (Project Object Model) and referred to 'pom.xml.'
Using Maven framework, we can easily manage following tasks in any project-
- Build cycle
- Project Documentation
- Report Checks
- Scrums management
- Release Information
Basic uses of Maven are-
- Enforces a standard directory structure.
- Provide a reusable and easy to maintain project structure.
- Resolve packages dependencies.
- Provide a configuration management framework.
Download Appium Maven Dependencies
Before start writing APPIUM test with Maven, we have to download the JAR file from Maven central repository website.
or directly add below mentioned POM.xml artifact:
<dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <version>3.4.1</version> </dependency>
Please go through our Maven tutorial to learn how to configure Maven with Eclipse.
After configuring Maven plug-in Eclipse. It will be ready to test any android .apk application with Appium and Maven.
Step 1) In this step,
- Go to NEW >> select Maven project
- Click on 'next' button
Step 2) Then in 'New Maven Project' window, enter 'Appium Test' in Group Id and Artifact Id column. In this step, you have to enter.
- Group Id
- Artifact Id
- Name and Description
Clicking on Finish button. It will open a new class on the defined Group Id (AppiumTest) name.
Step 3) To start with Appium script. Right click on 'src/main/java' from left side explorer window. Then select New >> class. Write the Appium code inside the selected class.
Step 4) In the same project, click over pom.xml from left explorer menu. All dependencies will be visible by default in 'pom.xml' tab. Refer to the Image below-
If in the case of default pom.xml does not exist then just add all Maven Appium dependencies. (extracted from Maven central repository website}
Step 5) Now, right click on 'pom.xml' from left explorer or over the xml code for 'AppiumTest' project. Then click 'Run As >> Maven Clean' option.
While running, the user could see all Maven related jar files and success message. Hence, this way the user can run APPIUM test with Maven configured environment.
- Maven is a JAVA based Project Management Framework.
- It is pre-defined and declared in XML format called as POM (Project Object Model) and referred to 'pom.xml'.