-
Notifications
You must be signed in to change notification settings - Fork 19
/
pom.xml
164 lines (160 loc) · 6.5 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?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.abcnull</groupId>
<artifactId>apitest4j</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>API Test</name>
<!-- 属性配置 -->
<properties>
<!-- 指定编码方式和 JDK 8 -->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- 依赖版本信息 -->
<lombok.version>1.18.4</lombok.version>
<junit5.version>5.7.0-M1</junit5.version>
<slf4j.version>1.7.25</slf4j.version>
<log4j.version>2.11.1</log4j.version>
<restassured.version>4.2.0</restassured.version>
<testng.version>6.14.3</testng.version>
<httpclient.version>4.5.9</httpclient.version>
<gson.version>2.8.5</gson.version>
<allure.version>2.13.5</allure.version>
<compile-plugin.version>3.8.0</compile-plugin.version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
<aspectj.version>1.8.10</aspectj.version>
<!-- jenkins 参数化构建 -->
<xml.file>${env.xmlFileName}</xml.file>
<param1>${env.param1}</param1>
<param2>${env.param2}</param2>
<param3>${env.param3}</param3>
</properties>
<dependencies>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
<!-- slf4j -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- rest-assured -->
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>${restassured.version}</version>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>json-path</artifactId>
<version>${restassured.version}</version>
</dependency>
<!-- testng -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
</dependency>
<!-- httpclient -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<!-- gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
</dependency>
<!-- allure 2 -->
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>${allure.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 编译插件 compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compile-plugin.version}</version>
<configuration>
<!-- 使用jdk 1.8的版本来编译 -->
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 测试插件 surefire -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<!-- allure 2 配置 -->
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<!-- 指定 xml 文件 -->
<suiteXmlFiles>
<!-- 通过美元符的形式可以将 jenkins 中参数传递过来,指定要运行的 xml 名 -->
<!-- <suiteXmlFile>${xml.file}</suiteXmlFile> -->
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
<!-- 传入 xml 中 -->
<systemPropertyVariables>
<!-- jenkins 参数一 -->
<param1>${param1}</param1>
<!-- jenkins 参数二 -->
<param2>${param2}</param2>
<!-- jenkins 参数三 -->
<param3>${param3}</param3>
</systemPropertyVariables>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
<dependencies>
<!-- allure 2 配置依赖 -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>