<project> pom文件的*节点 <modelVersion> object model版本,对Maven2和Maven3来说,只能是4.0.0 <groupId> 项目创建组织的标识符,一般是域名的倒写 <artifactId> 定义了项目在所属组织的标识符下的唯一标识,一个组织下可以有多个项目 <version> 当前项目的版本,SNAPSHOT,表示是快照版本,在开发中 <packaging> 打包的方式,有jar、war、ear等 <name> 项目的名称 <url> 项目的地址 <properties> 属性配置,比如:<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependencies> 构建项目依赖的jar <?xml version="1.0" encoding="UTF-8"?> <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.weiKeAutomation.dubo</groupId> <artifactId>test</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <name>包名</name> <url>http://maven.apache.org</url> <properties> <!-- 文件拷贝时的编码 --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <!-- 编译时的编码 --> <!-- <maven.compiler.encoding>UTF-8</maven.compiler.encoding>--> <!-- <maven.compiler.source>11</maven.compiler.source>--> <!-- <maven.compiler.target>11</maven.compiler.target>--> </properties> <dependencies> <!-- Testng PC--> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.9.10</version> </dependency> <!-- Junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <!-- Selenium --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.14.0</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-server</artifactId> <version>3.14.0</version> </dependency> <!-- Java-Client PC--> <dependency> <groupId>io.appium</groupId> <artifactId>java-client</artifactId> <!-- <version>3.3.0</version>--> <version>7.3.0</version> </dependency> <!-- rest-assured --> <dependency> <groupId>io.rest-assured</groupId> <artifactId>rest-assured</artifactId> <version>3.0.5</version> </dependency> <!-- https://mvnrepository.com/artifact/org.json/json --> <!-- <dependency>--> <!-- <groupId>org.json</groupId>--> <!-- <artifactId>json</artifactId>--> <!-- <version>2.0</version>--> <!-- </dependency>--> <!--jsonschema相关--> <dependency> <groupId>com.jayway.restassured</groupId> <artifactId>json-schema-validator</artifactId> <version>2.8.0</version> </dependency> <!-- ExtentReport --> <dependency> <groupId>com.relevantcodes</groupId> <artifactId>extentreports</artifactId> <version>2.40.2</version> </dependency> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.23</version> </dependency> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>3.0</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> <version>3.3.0</version> </dependency> <!-- TestngReport --> <dependency> <groupId>org.uncommons</groupId> <artifactId>reportng</artifactId> <version>1.1.4</version> </dependency> <!-- <dependency>--> <!-- <groupId>org.uncommons</groupId>--> <!-- <artifactId>reportng</artifactId>--> <!-- <version>1.1.4</version>--> <!-- <scope>test</scope>--> <!-- <exclusions>--> <!-- <exclusion>--> <!-- <groupId>org.testng</groupId>--> <!-- <artifactId>testng</artifactId>--> <!-- </exclusion>--> <!-- </exclusions>--> <!-- </dependency>--> <dependency> <groupId>net.sf.saxon</groupId> <artifactId>saxon</artifactId> <version>8.7</version> </dependency> <dependency> <groupId>org.apache.velocity</groupId> <artifactId>velocity</artifactId> <version>1.7</version> </dependency> <!-- Excel --> <dependency> <groupId>jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.44</version> </dependency> <dependency> <groupId>com.jcraft</groupId> <artifactId>jsch</artifactId> <version>0.1.54</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.6.6</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.6.6</version> </dependency> </dependencies> <build> <!--解决No goals have been specified for this build.--> <defaultGoal>compile</defaultGoal> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.java</include> <include>**/*.xml</include> <include>**/*.properties</include> </includes> <!-- 是否替换资源中的属性--> <filtering>false</filtering> </resource> <resource> <directory>src/test/java</directory> <includes> <include>**/*.java</include> <include>**/*.xml</include> <include>**/*.properties</include> </includes> <!-- <excludes> --> <!-- <exclude>**/*.properties</exclude> --> <!-- <exclude>com/test/aboutjar/*</exclude> --> <!-- </excludes> --> <!-- 是否替换资源中的属性--> <filtering>false</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> <!-- <configuration>--> <!-- <verbose>true</verbose>--> <!-- <fork>true</fork>--> <!-- <!–你的jdk地址–>--> <!-- <executable>C:/Program Files/Java/jdk1.8.0_301/bin</executable>--> <!-- </configuration>--> </plugin> <!--jenkins 运行 输入mvn test就可以编译执行testng.xml文件了,不依赖什么环境配置等--> <!--maven-surefire-plugin的test目标会自动执行测试源码路径(默认为src/test/java/)下所有符合一组命名模式的测试类--> <!--<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.7.1</version> <configuration> <suiteXmlFiles> <suiteXmlFile>WebWeiKeTestngReport.xml</suiteXmlFile> </suiteXmlFiles> </configuration> </plugin> --> <!--<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <phase>prepare-package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>false</overWriteSnapshots> <overWriteIfNewer>true</overWriteIfNewer> </configuration> </execution> </executions> </plugin>--> <!--<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <mainClass>TestCases.Main</mainClass> </manifest> </archive> </configuration> </plugin>--> </plugins> </build> </project>