Maven - pom.xml | Selenium Forum
M
Posted on 18/04/2016
Hi,

I have created a Maven project in Eclipse. In pom.xml, i have added the dependencies for selenium and TestNG. Along with that, do we need to specify the plugins for 'maven-compiler-plugin' and 'maven-surefire-plugin' as well as mentioned below: Please confirm.

<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>com.orglearningMaven</groupId>
<artifactId>MavenProject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>MavenProject</name>
<url>http://maven.apache.org</url>

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

<build>
<plugins>
<!-- Compiler plug-in -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<!-- Below plug-in is used to execute tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<!-- TestNG suite XML files -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>2.53.0</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>

</dependencies>
</project>

Thanks,

M
Replied on 18/04/2016

hi,

what is the problem?


M
Replied on 18/04/2016

Hi,

I have created a Maven project in Eclipse. In pom.xml, i have added the dependencies for selenium and TestNG. Along with that, do we need to specify the plugins for 'maven-compiler-plugin' and 'maven-surefire-plugin' as well? Please confirm.


M
Replied on 18/04/2016

if your project runs fine then there is no problem.