Maven Build Profiles Example
Access the URL to learn Maven Basics: http://total-qa.com/advanced-selenium/maven/
Maven is a Build Automation Tool helps in packaging different build types as Jar,War,EAR.
EAR -> Enterprise Archive
JAR -> JAVA Archive
WAR-> Web Archive
Refer to the link for more details: https://stackoverflow.com/questions/1594667/war-vs-ear-file
Sometimes, its require to run the Selenium WebDriver Automation tests against the Multiple Environments as DEV and QA. Maven has a provision of profiles which helps to run the test with multiple environments.
Configure the pom.xml with different profiles as mentioned below:
Running the Maven Project using Profile Names:
Right-click on the project select Run as->Run Configurations
Provide the maven goals and profile Names:
Executing the Maven Project with maven goals and profile Names from command line:
- Download the Apache Maven Software from the link https://maven.apache.org/download.cgi accordingly as per the Operating System.
- Unzip the file and set the Class-path for the Apache Maven.
- Run the Maven Project from the command line with goals and profile name