Maven Build Profiles Example

      No Comments on Maven Build Profiles Example

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

Maven Run Configuration

Maven Run Configuration

Provide the maven goals and profile Names:

maven goals profile

maven goals profile

Executing the Maven Project with maven goals and profile Names from command line:

  1. Download the Apache Maven Software from the link https://maven.apache.org/download.cgi accordingly as per the Operating System.
  2. Unzip the file and set the Class-path for the Apache Maven.
  3. classpath

    classpath

  4. Run the Maven Project from the command line with goals and profile name

Refer to the below Links for Practise
Selenium Wiki
Complete List of Selenium Basics
50 Real Time Interview Questions
Real Time Scenario’s
Java Platform Standard Edition 8 Documentation
Complete List of Java Basics
Java Quiz
Java OOPS Quiz
Selenium Advanced Quiz
Selenium Quiz

Leave a Reply

Your email address will not be published. Required fields are marked *