Saturday, 13 October 2012

Configured pom.xml file in maven project for selenium


How to configure pom.xml file in maven project for selenium.below is the code for same.
if you want to add more third party jar files then use dependency tag in pom.xml.
Mentioned some third party jar in below pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelversion>4.0.0</modelVersion>
<groupid>MavenTest</groupId>
<artifactid>com.companyName.web.test</artifactId>
<version>0.0.1-SNAPSHOT</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<plugin>
<groupid>org.apache.maven.plugins</groupId>
<artifactid>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactid>maven-failsafe-plugin</artifactId>
<version>2.12</version>
<configuration>
<suitexmlfiles>

<suitexmlfile>${basedir}/src/main/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
<skip>false</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupid>org.apache.maven.plugins</groupId>
<artifactid>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>


</plugins>
</build>

<dependencies>
<dependency>
<groupid>org.seleniumhq.selenium</groupId>
<artifactid>selenium-firefox-driver</artifactId>
<version>2.25.0</version>
</dependency>
<dependency>
<groupid>org.seleniumhq.selenium</groupId>
<artifactid>selenium-java</artifactId>
<version>2.25.0</version>
</dependency>
<dependency>
<groupid>org.seleniumhq.selenium</groupId>
<artifactid>selenium-server</artifactId>
<version>2.25.0</version>
</dependency>
<dependency>
<groupid>org.testng</groupId>
<artifactid>testng</artifactId>
<version>6.7</version>
</dependency>
<dependency>
<groupid>org.jsoup</groupId>
<artifactid>jsoup</artifactId>
<version>1.6.3</version>
</dependency>
<dependency>
<groupid>javax.mail</groupId>
<artifactid>mail</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupid>mysql</groupId>
<artifactid>mysql-connector-java</artifactId>
<version>5.0.8</version>
</dependency>
<dependency>
<groupid>log4j</groupId>
<artifactid>log4j</artifactId>
<version>1.2.17</version>
</dependency>   
<dependency>
<groupid>com.jcraft</groupId>
<artifactid>jsch</artifactId>
<version>0.1.44-1</version>
</dependency> 

</dependencies>
</project>


No comments:

Post a Comment