-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpom.xml
More file actions
245 lines (224 loc) · 8.26 KB
/
pom.xml
File metadata and controls
245 lines (224 loc) · 8.26 KB
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<?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>org.example</groupId>
<artifactId>moshi</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<!-- Using latest LTS version (17) -->
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<!-- Defines UTF-8 encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- SortPom -->
<sortpom.version>3.0.0</sortpom.version>
<!-- Spotless -->
<spotless.version>2.22.8</spotless.version>
</properties>
<dependencies>
<!--
We've switched to using Moshi for serialization/deserialization of JSON.
https://github.com/square/moshi
We used to use Gson, but Gson isn't being maintained actively anymore,
and doesn't interact well with records. The developer who switched
from Gson to Moshi has added remarks (e.g., consistent exception use).
Moshi 1.13.0 was released in December, 2021
We'll also use Moshi's adapters package, which includes pre-built adapters
for quite a few things, including polymorphic adapters.
The adapters README.md includes a "latest.version" version; replaced with
latest version as of August 2022.
-->
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.squareup.moshi</groupId>
<artifactId>moshi-adapters</artifactId>
<version>1.13.0</version>
</dependency>
<dependency>
<groupId>com.sparkjava</groupId>
<artifactId>spark-core</artifactId>
<version>2.9.3</version>
</dependency>
<!-- This is a library that is requested by spark to assist in debug logging
This particular implementation suppresses a lot of the logging to avoid
clogging the console.
-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!--
The Compiler Plugin is used to compile the sources of your project.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-compiler-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <source>17</source>-->
<!-- <target>17</target>-->
<!-- </configuration>-->
<!-- </plugin>-->
<!--
We use Spotless to automate style checking and code formatting.
-->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>${spotless.version}</version>
<configuration>
<java>
<!-- style checking + formatting will apply to these files -->
<includes>
<include>src/main/java/**/*.java</include>
<include>src/test/java/**/*.java</include>
</includes>
<!-- standard import order -->
<importOrder/>
<!-- self-explanatory -->
<removeUnusedImports/>
<!-- use google-java-format: https://github.com/google/google-java-format -->
<googleJavaFormat/>
</java>
</configuration>
<executions>
<!-- checks formatting during compilation; will fix if errors exist -->
<execution>
<goals>
<goal>apply</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<!--
We use SortPom to apply ordering and formatting to this pom.xml file.
-->
<plugin>
<groupId>com.github.ekryd.sortpom</groupId>
<artifactId>sortpom-maven-plugin</artifactId>
<version>${sortpom.version}</version>
<configuration>
<predefinedSortOrder>custom_1</predefinedSortOrder>
<lineSeparator>\n</lineSeparator>
<encoding>${project.build.sourceEncoding}</encoding>
<sortProperties>true</sortProperties>
<sortDependencies>scope</sortDependencies>
<expandEmptyElements>false</expandEmptyElements>
</configuration>
<executions>
<!-- sorts the pom.xml file during the compile phase -->
<execution>
<goals>
<goal>sort</goal>
</goals>
<phase>compile</phase>
</execution>
</executions>
</plugin>
<!--
We use SpotBugs to detect bugs automatically.
-->
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.6.0.0</version>
<dependencies>
<!-- overwrite dependency on spotbugs if you want to specify the version of spotbugs -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>4.7.0</version>
</dependency>
</dependencies>
</plugin>
<!-- The Site Plugin is used to generate an HTML representation of
the project's metadata. The generated HTML also includes the project's
reports that were configured in the POM. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- JaCoCo is used to generate reports about test coverage -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
<!-- Without this, Maven will not run_gpt JUnit tests with
JUnit, and we'll lack @BeforeAll/@BeforeEach/etc.
-->
<!-- The Surefire Plugin is used during the test phase of
the build lifecycle to execute the unit tests of an application.
It generates reports in TXT and XML formats. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<!-- The maven enforcer plugin enforces that the maven version is 3.6.0 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M3</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.6.0</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>