官术网_书友最值得收藏!

Understanding pom.xml

It's time to explore pom.xmlThis is what pom.xml looks like:

<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>org.packt.selenium</groupId>
<artifactId>FirstSelenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
</project>

Group ID and Artifact ID that you added in the previous screens have appeared in the preceding file, inside the Project tag. In order to work with Selenium, we will need to add Selenium dependencies within the Project tag. Let's go ahead and add those from the Maven repository:

  1. Go to the Maven repository (https://mvnrepository.com) and grab the dependency shown here:
      <!-- 
https://mvnrepository.com/artifact/org.seleniumhq.selenium/
selenium-java -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>
  1. Place this dependency inside a dependencies tag, as shown in the pom.xml file here:
      <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>org.packt.selenium</groupId>
<artifactId>FirstSelenium</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<!--
https://mvnrepository.com/artifact/org.seleniumhq.selenium/
selenium-java -->

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.13.0</version>
</dependency>
</dependencies>
</project>
  1. Save the pom.xml. You will see a small activity in the bottom-right corner of Eclipse, stating that the project is being built.

The Maven Dependencies folder now gets populated with all of the downloaded JARs, as shown previously.

主站蜘蛛池模板: 永康市| 仁化县| 彩票| 龙游县| 易门县| 云南省| 崇州市| 鹤峰县| 介休市| 岚皋县| 南雄市| 新巴尔虎右旗| 宜城市| 沽源县| 望谟县| 阿城市| 资阳市| 屯留县| 天全县| 平武县| 黄浦区| 尉犁县| 休宁县| 安丘市| 织金县| 蛟河市| 远安县| 榕江县| 丁青县| 英吉沙县| 浦城县| 博兴县| 乌审旗| 巢湖市| 布拖县| 建水县| 五指山市| 饶河县| 仙桃市| 章丘市| 方城县|