-
Notifications
You must be signed in to change notification settings - Fork 3
/
pom.xml
355 lines (325 loc) · 14.3 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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<?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.leokom.games</groupId>
<artifactId>chess</artifactId>
<version>0.7-SNAPSHOT</version>
<name>Leokom Chess</name>
<inceptionYear>2012</inceptionYear>
<!-- Added in order to support github-release-plugin.
This information is also useful itself for semantic purposes.
-->
<scm>
<url>https://github.com/lrozenblyum/chess</url>
<connection>scm:git:https://github.com/lrozenblyum/chess.git</connection>
</scm>
<!-- Trick to use mvn deploy goal
We don't have any 'Nexus'-like deploy target yet.
However I want to be able to use a convenient command mvn clean deploy
so I specify local storage here -->
<distributionManagement>
<repository>
<id>internal</id>
<url>file://${project.build.directory}/maven-repository</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2version}</version>
<!-- I like keeping scope as more precise as possible
However log4j2 developers say that making it compile
may improve performance for custom plugins
-->
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit4</artifactId>
<version>0.11.0</version>
<scope>test</scope>
</dependency>
<!-- ArchUnit uses SLF4j, using Log4j2 implementation to avoid
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j2version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mutabilitydetector</groupId>
<artifactId>MutabilityDetector</artifactId>
<version>0.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.23.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.19.0</version>
<scope>test</scope>
</dependency>
<!-- To try improved lambdas in tests, if it succeeds
we may use it in core as well -->
<dependency>
<groupId>org.jooq</groupId>
<!-- When we upgrade to Java9 we should change to simply jool -->
<artifactId>jool-java-8</artifactId>
<version>0.9.14</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- I'm reluctant to update to 27.0.1 because of https://groups.google.com/forum/#!topic/guava-announce/Km82fZG68Sw
and a weird additional empty artifact which comes with guava then -->
<version>26.0-jre</version>
<!-- The exclusions are done due to https://github.com/google/guava/issues/2824 -->
<exclusions>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.j2objc</groupId>
<artifactId>j2objc-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fluxchess.jcpi</groupId>
<artifactId>jcpi</artifactId>
<version>1.4.1</version>
</dependency>
</dependencies>
<build>
<finalName>${brandName}</finalName>
<plugins>
<!-- Additionally configuring maven clean plug-in in order to clean the deploy directory and thus remove potential old artifacts -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.deployDirectory}</directory>
<includes>
<!-- Let's clean just jars. For example old logs might be useful -->
<include>**/*.jar</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
<!-- Copy dependencies into the deploy directory -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- We're interested only in compile&runtime dependencies -->
<includeScope>runtime</includeScope>
<outputDirectory>${project.deployDirectory}\${dependenciesDirectory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Set up Jar generation properties, e.g. automatic generation of manifest -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<outputDirectory>${project.deployDirectory}</outputDirectory>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>${dependenciesDirectory}</classpathPrefix>
<mainClass>com.leokom.games.chess.MainRunner</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- Assembly plug-in will allow us create a *.zip artifact with binaries
which previously was created manually -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<finalName>${binaryReleaseName}</finalName>
<descriptors>
<descriptor>src/assembly/assembly-release-archive.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<!-- As an alternative we might use a separate profile.
Specifying the phase that is earlier than deploy which our release-plugin is bound to -->
<phase>install</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Thanks to this plug-in we'll be able to upload releases to GitHub -->
<plugin>
<groupId>de.jutzig</groupId>
<artifactId>github-release-plugin</artifactId>
<version>1.3.0</version>
<configuration>
<releaseName>${project.version} release</releaseName>
<description>
to be defined
</description>
<tag>${project.version}</tag>
<!-- Automatically it's based on SNAPSHOT presence, however in chess at the moment
we consider all 0.* as pre-releases -->
<prerelease>true</prerelease>
<failOnExistingRelease>true</failOnExistingRelease>
<!-- The sources will be added by default. Adding binaries here -->
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<!-- Using the wildcard because maven-assembly-plugin by default adds
suffix with assembly id (like '-bin')-->
<include>${binaryReleaseName}*.zip</include>
</includes>
</fileSet>
</fileSets>
</configuration>
<executions>
<execution>
<phase>deploy</phase>
<goals>
<goal>release</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<!-- The most recent plugin at 2019-02-17, although the versioning scheme is unclear -->
<!-- NOTE: it should be used in pair with maven deploy plug-in of the same version -->
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.0.0-M1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M3</version>
</plugin>
<!-- Although we're not using it directly, it's part of Maven lifecycle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<!-- By default 'report' is bound to verify phase but we don't call that yet in CI -->
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
<!-- Preventing [WARNING] Using platform encoding to copy filtered resources -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Naming convention inspired by http://stackoverflow.com/a/30318342/1429367 -->
<log4j2version>2.17.1</log4j2version>
<project.deployDirectory>E:\Games\WinBoard-4.8.0\${brandName}</project.deployDirectory>
<dependenciesDirectory>lib</dependenciesDirectory>
<!-- The variable defines chess brand without spaces, should be used for building various artifacts -->
<brandName>LeokomChess</brandName>
<binaryReleaseName>${brandName}-${project.version}</binaryReleaseName>
</properties>
</project>